. NET Network Programming Learning notes

Source: Internet
Author: User

    • IPAddress Class Usage Examples:

Ipaddress.parse ("192.168.0.1")//Convert the IP address of type string to IPAddress instance

Ipaddress.loopback//Get a local loopback IP address, specifically 127.0.0.1

Ipaddress.broadcast//Get the address of the broadcast IP address, specifically 255.255.255.255

Ipaddress.any//Specific address is 0.0.0.0,Socket. The Bind method uses the any field to indicate that the Socket instance should listen for client activity on all network interfaces

    • ipendpoint class contains the host and local or remote port information needed a application to connect to a service on a host. " The ipendpoint  class contains the host and local or remote port information required by the application to connect to the service on the host, which uniquely determines the location of the program or process on the network

The specific application method is IPEndPoint (Ipaddress,port), IPAddress is the specific value of the IPAddress class mentioned above, port value network port number.

The port number is a two-byte integer, so the value range is 0~65535, and these port numbers are divided into three categories:

    1. The scope of the first class is 0~1023, known as a well-known port, which is used by specific network programs, for example, the TCP protocol uses port 80 to complete the transmission of the HTTP protocol.
    2. The scope of the second class is 1024~49151, called the enlistment port, and should not normally be used in the program.
    3. The scope of the third class is 49152~65535, known as private ports, which can be used by ordinary user programs.

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.