C # differences between Socket and TCP connections,

Source: Internet
Author: User

C # differences between Socket and TCP connections,
Introduction to layer-7 network communication reference models:Physical Layer: HUB, network cable link layer: MAC, ARP, switch network layer: IP, ICMP, IGMP, router transmission layer: TCP, UDP session layer: HTTP, SMTP, FTP, POP3 presentation layer: SOAP, SSL application layer: HTTP, POP3, etc.Difference Between TCP and Socket:Socket is a network layer operation. TcpClient is the operation on the transport layer.Use Socket to access the HTTP service:Network Layer --> transmission layer --> Session LayerUse TcpClient to access HTTP Services:Transport Layer --> the protocol at the Session Layer is IP, and the protocol at the transport layer is TCP. The essential difference is that the network layer adds data to the IP address, and the IP address serves all system ports. The transport layer only adds data to the port, that is, the operating system service port. The Network Layer/output layer provides connection-oriented and connectionless services.Application Selection of TcpClient and Socket in C:Only use TcpClient or UdpClient for host, port, and data transmission; use Socket for IP packets, routes, and IP packets;

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.