Python Network programming socket

Source: Internet
Author: User
Socket syntax and related

The socket is for HTTP, TCP/IP, send/receive ..... And so on the encapsulation of the underlying network protocol, the socket is an implementation of the "Open-write/read-close" mode.

Socket implementation send data (send), receive data (receive)

Socket concept

The socket is essentially a network between 2 computers, set up a channel, two computers through this channel to achieve the transmission of data. We know that network communication is based on the Ip+port can be targeted to the specific machine specific services, the operating system has 0-65535 ports, each port can be independent of external services, if a company than a computer, the company's switchboard number is equivalent to the IP address, Each employee's extension number is equivalent to the port, you want to find someone in the company, you must first call the switchboard, and then ext.

The establishment of a socket must have at least 2 end, a server, a client, the service side passively wait and receive requests, the client initiates the request, after the connection is established, the two sides can send data to each other.

IP Plus port number is required for network traffic.

Socket Families (Address cluster): Describes the protocol type, which refers to TCP/IP

Http://www.cnblogs.com/alex3714/articles/5227251.html

8699198

Python Network programming 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.