soConnect (Function) |
Top Previous Next |
The soConnect function establishes a connection to the specified address.
On a blocking socket, the return value indicates success or failure of the connection attempt. With a non-blocking socket, the connection attempt cannot be completed immediately. In this case soConnect will return -4; however the connection attempt continues.
When a connection between sockets is broken, the socket that was connected should be discarded and a new socket should be created. When a problem develops on a connected socket, it must be discarded and a new socket should be created, in order to return to a stable point.
For a connectionless socket (type _SO_TYPE_DGRAM), the operation performed by this function is merely to establish a default destination address that can be used on subsequent calls to the soSend function.
Input: socket : SYSHANDLE Handle to the socket.
address : STRING The address to connect to. See also soAddrInetSet.
Returns: INT
Declaration: FUNCTION soConnect : INT;
Example:
|