Socket:
A socket is also called a socket, and an application usually makes a request to the network through a "socket" or responds to a network request, making it possible to communicate between hosts or between processes on a computer.
Python provides two levels of access to network services:
- The low-level network service supports the basic socket and provides the standard BSD Sockets API, which can access all the methods of the underlying operating system socket interface.
- The high-level Network Service module, Socketserver, provides a server-centric class that simplifies the development of network servers.
Socket () function:
Python, use the socket () function to create a socket
Socket.socket (Family,type,protocol)
Parameters
- Family: The socket family can make Af_unix or af_inet
- Type: The socket type can be divided into either a connection-oriented or a non-connected
SOCK_STREAMSOCK_DGRAM
- Protocol: General does not fill the default is 0.
Socket Object Method:
Python Network programming