Function GetSocketName (Sock:Longint;Var Addr;Var Addrlen:Longint) : Longint;
GetSockName returns the current name of the specified socket Sock. Addr should point to enough space to store the name, the amount of space pointed to should be set in Addrlen. When the function returns succesfully, Addr will be filled with the name, and Addrlen will be set to the length of Addr.
Errors are reported in SocketError, and include the following: