Function SocketGetSockName() Professional

Returns the current name of the specified socket.

SocketGetSockName( <nSocket>  , ;
                   [@<nError>] ) --> aInetAddr|NIL
This is a numeric socket descriptor identifying a socket.
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.

The function returns an array containing IP address information of the local socket, or NIL on failure. The following #define constants are available in the file SOCKET.CH to access the individual elements of the IP address array:

Constants for the IP address array
Constant Description
IPADDR_ADDR Numeric IP address in network byte order.
IPADDR_FAMILY Address family (Windows sockets support only AF_INET).
IPADDR_PORT Number of port the socket is associated with.


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.