lib
-
Tcp/Ip_Lib_CC 2017. 12. 17. 20:44
#include #include #include #include #include #include #include #include /** 주소 정보가 IP address인지 domain명인지를 판단하기 위한 함수* IP address이면 1 그렇지 않으면 0을 return 함*/static int is_ipaddr(const char *addr){ while(*addr) { if(('0' h_length); } if((sock = socket(AF_INET, SOCK_STREAM, 0)) == -1) { return -1; } if(connect(sock, (struct sockaddr *)&server_addr, sizeof(struct sockaddr_in)) == -1) { close(sock); r..