UDT Reference: UDT Functions |
The getsockname function retrieves the local address associated to a socket.
int getsockname( struct sockaddr *name, int *namelen ); |
On success, 0 is returned; Otherwise, UDT::ERROR is returned and the specific error information can be retrieved by getlasterror.
Error Code | Comment |
---|---|
5003 |
invalid parameters. |
5004 |
u is an invalid UDT socket. |
5005 |
u is not bound or connected yet. |
The getsockname method retrieves the local address associated to the socket. Before the socket is associated with any address (through bind or connect), this method will fail because there is no meaningful address bound to the socket.