Function SocketClose() Professional

Closes an open socket.

Syntax
SocketClose( <nSocket> , ;
             [@<nError>] ) --> lSuccess
Parameters
<nSocket>
This is the numeric socket descriptor of the socket to close.
<nError>
If this parameter is passed by reference to the function, it gets assigned a numeric error code when the function fails. #define constants beginning with WSAE are available in the file SOCKET.CH to identify an error condition.
Return

The function returns .T. (true) if the socket is closed successfully, otherwise .F. (false) is returned.

Description

This function closes a socket and releases all related resources, thus making it unusable for re-opening. It is recommended to call SocketShutdown() prior to closing a socket so that pending send/receive operations can be completed (graceful instead of abortive close).

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.