Contents

sock_connect

Declaration

errno_t sock_connect(socket_t so, const struct sockaddr *to, int flags);

Parameters

  • so:

    The socket to be connect.

  • to:

    The remote address the socket should connect to.

  • flags:

    Flags for connecting. The only flag supported so far is MSG_DONTWAIT. MSG_DONTWAIT will perform a non-blocking connect. sock_connect will return immediately with EINPROGRESS. The upcall, if supplied, will be called when the connection is completed.

Return Value

0 on success, EINPROGRESS for a non-blocking connect that has not completed, otherwise the errno error.

Discussion

Initiates a connection on the socket. See 'man 2 connect' for more information.

See Also

Network Kernel Extensions