![](http://i1.daumcdn.net/thumb/C148x148/?fname=https://blog.kakaocdn.net/dn/PUuED/btqygUlO60T/JYhNAj8T117o8Xg0zZNoG1/img.png)
Client code 'test.c' compile gcc test.c -o test Server code 'server.c' compile gcc server.c -o server open 2 terminal, run server, check IP by 'ifconfig'and connect client terminal_server terminal_client ์๋ฒ ๊ตฌ๋ํ, IP๋ก ํด๋ผ์ด์ธํธ์์ ์๋ฒ๋ก ์ฐ๊ฒฐํ๋ฉด ํด๋ผ์ด์ธํธ์์ ์ ๋ ฅํ ๋ฌธ์๊ฐ ์๋ฒ์์ ์ถ๋ ฅ๋๋๊ฒ์ ํ์ธ๊ฐ๋ฅ. ๋ฌผ๋ก , ๋ก์ปฌ์์ ์คํํ ๊ฑฐ๋ฉด IP๋์ localhost๋ 127.0.0.1 ๋๋ ค๋๋ฌด๊ด
code from Computer_Networks_Larry_Peterson_5ed #include #include #include #include #include #define SERVER_PORT 47500 #define MAX_PENDING 5 #define MAX_LINE 256 int main() { struct sockaddr_in sin; char buf[MAX_LINE]; int len; int s, new_s; /* build address data structure */ bzero((char *)&sin, sizeof(sin)); sin.sin_family = AF_INET; sin.sin_addr.s_addr = INADDR_ANY; sin.sin_port = htons(SERVER_..
![](http://i1.daumcdn.net/thumb/C148x148/?fname=https://blog.kakaocdn.net/dn/cbTEWA/btqyfryfHjQ/zdMhZ0DIdrLvQ25lxiK0X0/img.png)
code from Computer_Networks_Larry_Peterson_5ed #include #include #include #include #include #include #include #define SERVER_PORT 47500 #define MAX_LINE 256 int main (int argc, char * argv[]) { FILE *fp; struct hostent *hp; struct sockaddr_in sin; char *host; char buf[MAX_LINE]; int s; int len; if (argc==2) { host = argv[1]; } else { fprintf(stderr, "usage: simplex-talk host\n"); exit(1); } /* t..
- Total
- Today
- Yesterday
- ํด์ธ์ฌํ
- ์ฐ์ํ ํ ํฌ์ฝ์ค
- ๋ฆฌ๋ฒ์ฑ
- queue
- sort
- javascript
- JPA
- dfs
- ํ๊ณ
- Java
- FRAGMENT
- git
- OneToMany
- Vo
- socket
- brute-force
- bfs
- reversing
- Android
- ํ๋ก๊ทธ๋๋จธ์ค
- mysql
- Stack
- Android Studio
- ์นํดํน
- graph
- Data Structure
- Algorithm
- ๊ฐ๋ฐ์
- webhacking.kr
- C
์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |