Python full stack "socket network programming"

Source: Internet
Author: User

Python full stack "socket network programming"

The contents of this chapter:

    1. Socket
    2. IO multiplexing (select)
    3. Socketserver Module (threadingtcpserver Source Analysis)

Socket

Sockets are also commonly referred to as socket

Used to describe the IP address and port, which is a handle to a communication chain, the application usually makes a request to the network through a "socket" or answers a network Request.

Sockets originate from unix, and one of the basic philosophies of Unix/linux is "everything is file", and the file is operated with "open" "read and write" "off" Mode. Socket is an implementation of this pattern, the socket is a special kind of file, some of the socket function is the operation of it (read/write io, open, Close)

The difference between a socket and file:

    • The file module is "open", "read and write" "close" for a specified document
    • The socket module is "open", "read and write" "off" for server-side and client sockets

Why learning to socket must first learn the Internet Protocol:

1. First: The goal of this lesson is to teach you how to develop your own c/s architecture software based on socket PROGRAMMING.

2. second: c/s architecture software (software belongs to the application Layer) is based on the network to communicate

3. Then: The core of the network is a stack of protocols, the protocol is the standard, you want to develop a network-based communication software, you must follow these STANDARDS.

Socket Layer

Python full stack "socket network programming"

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.