소켓 프로그래밍 예제소스 썸네일형 리스트형 [2009/06/01] 예제소스(helloworld_server2.c, echo_server_win.c, echo_client_win.c, echo_server.c, echo_client.c) /* helloworld_server2.c */ #include #include #include #include #include #include #include void error_handling(char *message); int main(int argc, char **argv) { int serv_sock; int clnt_sock; struct sockaddr_in serv_addr; struct sockaddr_in clnt_addr; int clnt_addr_size; char message[]="Hello World!\n"; if(argc!=2){ printf("Usage : %s \n", argv[0]); exit(1); } serv_sock=socket(PF_INET, SOCK_STREAM.. 더보기 [2009/05/31] 예제소스(helloworld_client.c) /* helloworld_client.c */ #include #include #include #include #include #include void error_handling(char *message); int main(int argc, char **argv) { int sock; struct sockaddr_in serv_addr; char message[30]; int str_len; if(argc!=3) { printf("Usage : %s \n", argv[0]); exit(1); } sock=socket(PF_INET, SOCK_STREAM, 0); if(sock == -1) error_handling("scoket() error"); memset(&serv_addr, 0, sizeof(se.. 더보기 이전 1 2 3 4 다음