The getsockname method retrieves the local address associated with a UDT socket.
On success, getlasterror returns 0 and the local 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 |
EINVPARAM | Invalid parameters. | |
EINVSOCK | 5004 | u is an invailid UDT socket. |
EUNBOUNDSOCK | 5005 | u is not bound to a local address yet. |
The getsockname retrieves the local address associated with the socket. The UDT socket must be bound explicitly (via bind) or implicitly (via connect), otherwise this method will fail because there is no meaningful address bound to the socket.