Network programming
1、 Seven layer model of network
From bottom to top are physical layer (circuit, wiring) - data link layer (switch) - network layer (TCP / IP, router) - transport layer - session layer - presentation layer (encoding, decoding, encryption, decryption, compression, decompression) - application layer (HTTP), but the TCP / IP model is network interface layer - network layer - transport layer - application layer
2、 Three handshakes and four waves
1. Three handshakes:
(1) The client sends a request to the network server (are you there?)
(2) The server responds to the client's request (I'm here)
(3) The server sends a request to the client (I'm here, are you there?)
2. Four waves
(1) The client sends a request to the server (I'm leaving)
(2) Server response client (mm)
(3) The client sends a request to the server again (I really want to leave)
(4) The server responds to the client (well, let's go)
3、 Main functions of commonly used InetAddress
Output results:
xxxx/192.168. 152.1192. 168.152. one
4、 Communication between TCP programming server and client
1. Server code