Like anetFormatAddr() but extract ip and port from the socket's peer/sockname. */
| 606 | |
| 607 | /* Like anetFormatAddr() but extract ip and port from the socket's peer/sockname. */ |
| 608 | int anetFormatFdAddr(int fd, char *buf, size_t buf_len, int fd_to_str_type) { |
| 609 | char ip[INET6_ADDRSTRLEN]; |
| 610 | int port; |
| 611 | |
| 612 | anetFdToString(fd,ip,sizeof(ip),&port,fd_to_str_type); |
| 613 | return anetFormatAddr(buf, buf_len, ip, port); |
| 614 | } |
no test coverage detected