GETPEERNAMETEXT(3)                                          GETPEERNAMETEXT(3)



NAME
       getpeernametext - report the IP address of the remote connection

SYNOPSIS
       #include <easyv6.h>

       char *getpeernametext (int socket, char *buf, size_t bytes);

DESCRIPTION
       Determine the remote IP address and port connected to socket and return
       a textual representation.

       If buf is NULL, malloc() enough memory to hold the IP  address.  Other-
       wise store the port followed by a nul (0) followed by the IP address in
       buf and return the IP address.

RETURN VALUE
       On success, copy a 0 terminated string containing the service  name  (a
       port number for TCP) into buf and return a 0 terminated string contain-
       ing the IP adddress.  On error, NULL is  returned,  and  errno  is  set
       appropriately.

ERRORS
       Refer to getpeername (2) for possible errno values.

EXAMPLE
       See listenbyname (3)

SEE ALSO
       addrinfototext(3),        connectbyaddrinfo(3),       connectbyname(3),
       listenbyname(3), timeoutgetaddrinfo(3),

AUTHOR
       libeasyv6 was written by William Herrin <bill@herrin.us>.



                                March 18, 2012              GETPEERNAMETEXT(3)
