The getpeername method retrieves the address informtion of the peer side of a connected UDT socket.
On success, getlasterror returns 0 and the peer address information is stored in name; otherwise it returns UDT::ERROR and the specific error information can be retrieved using getlasterror.
Error Name | Error Code | Comment |
ENOCONN | 2002 | u is not connected. |
EINVPARAM | 5003 | Invalid parameters. |
EINVSOCK | 5004 | u is an invailid UDT socket. |
The getpeername retrieves the address of the peer side associated to the connection. The UDT socket must be connected at the time when this method is called. The namelen must provide the leangth of the name parameter, which should be enough to hold the address information. On return, namelen contains the length of the result.