htons, htonl, ntohs, ntohl

#include <netinet/in.h>

uint32_t htonl(uint32_t hostlong);
uint16_t htons(uint16_t hostshort);
uint32_t ntohl(uint32_t netlong);
uint16_t ntohs(uint16_t netshort);

바이트 순서: 보통 PC에서 사용하는 것이 리틀 엔디언, 인터넷 표준 네트워크에서는 빅 엔디언 사용 (엔디언)

htons(3) - Linux man page

byte order 변환 API (host ↔ network byte order)

inet_addr

#include <netinet/in.h>

in_addr_t inet_addr(const char *cp);

inet_addr(3) - Linux man page

inet_addr(3) - IP주소를 network byte order의 binary 주소로...

select

/* According to POSIX.1-2001 */
#include <sys/select.h>

/* According to earlier standards */
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>

int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
					struct timeval *timeout);