Learn about c # data stream. It is naturally associated with sockets to facilitate in-depth understanding. First, let's take a look at the architecture of the socket-related classes in msdn: Definition: first, it is defined in Baidu Baike. Socket: multiple TCP connections or multiple application processes may need to transmit data through the same TCP port. To differentiate different application processes and connections, many computer operating systems provide interfaces called Sockets for applications to interact with TCP/IP protocols. The following is your understanding. Socket: The two endpoints of a connection. It can also be understood that sockets are used for communication or data exchange. Since there must be two endpoints for communication, just like the two endpoints of a line segment, just like from my home to your home, the two endpoints of this line segment are commonly known as sockets. Classification: one of them is classified as streaming sockets, packet sockets, and original sockets. This is classified by the second parameter in the constructor. However, I think this classification is not very good. I prefer the following classification methods: connection-oriented sockets and connectionless sockets. This is classified by the third parameter. In fact, the two classification methods are classified according to the parameters of the Socket class constructor. The constructor of the Socket class is: public Socket (AddressFamilyaddressFamily, // SocketTypesocketType of the network type, // ProtocolTypeprotocolType of the Socket type); // The protocol test case code used: connection-oriented Socket implementation: connectionless socket: