Python full stack "socket network programming" |
The contents of this chapter:
- Socket
- IO multiplexing (select)
- Socketserver Module (threadingtcpserver Source Analysis)
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"