connect to an address

C Specification

NLboolean nlConnect(NLsocket socket, const NLaddress *address)



[in]Specifies the socket used to connect.


[in]Specifies the address to connect to.


nlConnect attemps to connect to an address that has a socket listening to accept a connection.

Return values

If no error occurs, nlConnect returns NL_TRUE.

Otherwise, a value of NL_FALSE is returned, and the specific error code can be retrieved by calling nlGetError

Error codes

NL_INVALID_SOCKET : The socket is not valid.
NL_NULL_POINTER : A NULL pointer was passed to the function.
NL_SYSTEM_ERROR : A system Socket error has ocurred. The system error can be retrieved by calling nlGetSystemError.
NL_CON_REFUSED : The connection was refused.
NL_WRONG_TYPE : The function does not support this socket type (NL_BROADCAST).

See also


Back to the HawkNL index page

Go directly to the main HawkNL page at Hawk Software

© 2000-2002 Phil Frisbie.

Valid XHTML 1.0!