inet_ntoa | |
Prototype: |
#include <arpa/inet.h> const char* inet_ntoa(struct in_addr *addr); |
General Description: | This call converts the network-byte order binary to a human-readable form. Note that this call uses a static memory region: subsequent calls overwrite the older results. |
Return Value: | The address is in the returned string. |
Parameters | |
addr | The binary address (typically the address field of struct sockaddr_in). |
Possible Errors | |
(errno not set) | |
Examples | |
Clientfd = accept(serverfd, &addr, &addr_size); if ( clientfd > 0 ) printf("Connected %s:%d\n", inet_ntoa(addr.sin_addr), ntohs(addr.sin_port)); |