C # socket

Source: Internet
Author: User

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:

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.