Introducing sockets in Python
Sockets are the main components that allow us to exploit the capabilities of the operating system to interact with the network. You may regard sockets as a point-to-point channel of communication between a client and a server.
Network sockets are a simple way of establishing contact between processes on the same machines or on different ones. The socket concept is very similar to the use of file descriptors for UNIX operating systems. Commands such as read()
and write()
for working with files have similar behavior to dealing with sockets.
A socket address for a network consists of an IP address and port number. A socket's aim is to communicate processes over the network.
Network sockets in Python
Communication between different entities in a network is based on the classic socket concept developed by Python. A socket is specified by the machine's IP address, the port it is listening to, and the protocol it uses.
Creating a socket...