C # network applications

Source: Internet
Author: User
Tags file transfer protocol

1. TCP/IP Protocol Application
Understanding the TCP/IP protocol: TCP is the control transmission protocol, mainly used to process data packets,
IP is an Internet protocol, mainly responsible for data transmission paths.
The connection model is as follows: Application-Tcp protocol-IP protocol-Ethernet device-Internet
Layer for communication between applications: simple Email transmission (SMTP), file transfer protocol (FTP), and network remote access protocol (Telnet)
Transport Layer: In this layer, it provides data transmission between nodes and communication services between applications, as long as the function is data formatting, data validation and loss retransmission. For example, Transmission Control Protocol (TCP ),
User Datagram Protocol (UDP), TCP and UDP add data to the data packet and transmit it to the next layer. This layer is responsible for transmitting data and confirming that the data has been delivered and received
Network Layer: provides basic data packet transmission functions to enable each packet to reach the target host, such as Internet Protocol 9 (IP)
Network Interface Layer: receives and transmits IP data packets, receives physical frames from the network, extracts IP data packets, and transfers them to the next layer to manage the actual network media, define how to use the actual network to transmit data


2. Understand Scoket Protocol
Scoket is a network communication protocol over TCP/IP. Sockets can be seen as endpoints between communication hosts, forming a programming interface between a single host and the entire network.
The socket exists in the communication domain (the communication domain is an abstract concept introduced to process General threads through socket communication ). Different sockets in the same domain can communicate with each other.

There are two types of sockets: Synchronous socket and asynchronous socket.


3. synchronous socket
Using synchronous sockets technology to practice five aspects of network communication: Host resolution, host binding, port listening, data connection, and data transmission


1. Define host objects
There are two methods to define host objects. One is to directly use the IPEndPoint class. Using its constructor to specify the IPEndPoint constructor of the Host object has two parameters, the first parameter indicates the long IP address of the host, and the second parameter indicates the host port.
IPEndPoint myServer = new ipendpoints (1234.80 );
The second method is the IPAddress class, which converts the string to the IP address format.

 

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.