UV module

ConnectReq

Asynchronous connection request for TCP sockets and named pipes.

#include <icy/request.h>

struct ConnectReq

Defined in src/base/include/icy/request.h:149

List of all members

NameKindOwner
ConnectReqfunctionDeclared here
connectfunctionDeclared here
connectfunctionDeclared here
reqvariableInherited from Request
callbackvariableInherited from Request
RequestfunctionInherited from Request
invokefunctionInherited from Request
invokefunctionInherited from Request
defaultCallbackfunctionInherited from Request
TypetypedefInherited from Request
EventtypedefInherited from Request

Inherited from Request

KindNameDescription
variablereqThe underlying libuv request object.
variablecallbackCalled when the request completes.
functionRequest inlineConstruct the request and set req.data to this so callbacks can recover the wrapper pointer.
functioninvoke inline -> std::enable_if_t<!std::is_void< std::invoke_result_t< F, Args... > >::value, int >Call f with args. If f returns a non-zero libuv error code, the callback is invoked immediately with that status.
functioninvoke inline -> std::enable_if_t< std::is_void< std::invoke_result_t< F, Args... > >::value >Call f with args. Overload for void-returning functions; no error checking is performed.
functiondefaultCallback static inlineStandard libuv completion callback. Invokes callback with the status event and then deletes the Request wrapper.
typedefType
typedefEvent

Public Methods

ReturnNameDescription
ConnectReq inlineConstruct and set req.data to this.
autoconnect inlineInitiate a TCP connection to addr on handle.
autoconnect inlineInitiate a named-pipe connection to name on handle.

ConnectReq

inline

inline ConnectReq()

Defined in src/base/include/icy/request.h:152

Construct and set req.data to this.


connect

inline

inline auto connect(uv_tcp_t * handle, const struct sockaddr * addr)

Defined in src/base/include/icy/request.h:162

Initiate a TCP connection to addr on handle.

Returns

true if the connect request was submitted successfully.

Parameters

ParameterTypeDescription
handleuv_tcp_t *Initialized uv_tcp_t to connect.
addrconst struct sockaddr *Target address (IPv4 or IPv6 sockaddr).

connect

inline

inline auto connect(uv_pipe_t * handle, const char * name)

Defined in src/base/include/icy/request.h:172

Initiate a named-pipe connection to name on handle.

Returns

true if the connect request was submitted successfully.

Parameters

ParameterTypeDescription
handleuv_pipe_t *Initialized uv_pipe_t to connect.
nameconst char *Filesystem path (Unix) or named-pipe name (Windows).