UDT Reference: UDT Functions |
The getpeername function retrieves the name of the peer to which a socket is connected.
int getpeername(
struct sockaddr *name, ); |
On success, 0 is returned. Otherwise, UDT::ERROR is returned and the specific error information can be retrieved by getlasterror.
Error Code | Comment |
---|---|
2002 |
u is not connected. |
5003 |
invalid parameters. |
5004 |
u is an invalid UDT socket. |
The getpeername method retrieves the address of the peer side. The UDT socket must be connected at the time getpeername is called.