This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs. |
Get the name of the peer connected to a socket
#include <sys/socket.h> int getpeername( int s, struct sockaddr * name, socklen_t * namelen );
libsocket
Use the -l socket option to qcc to link against this library.
The getpeername() function returns the name of the peer connected to socket s. The name is truncated if the buffer provided is too small.
Safety: | |
---|---|
Cancellation point | Yes |
Interrupt handler | No |
Signal handler | No |
Thread | Yes |
accept(), bind(), getsockname(), socket()