Socket based on multi-process concurrent-process communication

socket: can be used for process communication between different devices

1. TCP communication protocol

1. IP
2, port
3, connection-oriented protocol, providing reliable service

1) Stop waiting
2) Timeout retransmission
3) Flow control
4) Congestion control
5) Data packet verification
6) Reorder out-of-sequence data packets
7) Response Mechanism
8) Drop Duplicate Data

4. Three-way handshake and four-way handshake
5. Server

1) clientId
2) Each client connection status
3) Only point-to-point unicast mode is supported
4) Receive client data and obtain its clientId, etc.
5) Actively disconnect from the target client
6) Keep-alive timing: reset the timer every time you interact with the client, and send a probe message if no client information is received within two hours

6. Client
1) is actively disconnected by the Server

Two, UDP

1.IP
2.port
3. No connection protocol, does not provide reliable interaction
4. Support unicast, multicast, broadcast

3. Realize the upper layer of socket

1、Ftp
2、http

4. Processing of sticky packets and subpackages of TCP Socket

Reference blog post:
TCP/UDP column
TCP subcontracting method && sticky packet processing strategy
tcp forced subcontracting_[TCP/IP] Diagram of TCP communication mechanism

F:\4. Cainiao Famous Enterprise Dream\1.C++ R&D Engineer_Classic\12.Socket

If there are any mistakes or deficiencies, welcome to comment and point out! Creation is not easy, please indicate the source for reprinting. If it is helpful, remember to like and follow (⊙o⊙)
For more content, please follow my personal blog: https://blog.csdn.net/qq_43148810

Guess you like

Origin blog.csdn.net/qq_43148810/article/details/118771051