Building a multiconnection client-server application using the main functions and methods in Python’s socket module, and sending messages and data between endpoints.
Sockets and the socket API are used to send messages across a network. They provide a form of inter-process communication (IPC). The network can be a logical, local network to the computer, or one that’s physically connected to an external network, with its own connections to other networks. The obvious example is the Internet, which you connect to via your ISP.
When using the loopback interface (IPv4 address 127.0.0.1 or IPv6 address ::1), data never leaves the host or touches the external network.
When using an IP address other than 127.0.0.1 or ::1 in the applications, it’s probably bound to an Ethernet interface that’s connected to an external network. This is the gateway to other hosts outside of the localhost.
Running the multiconnection server...
Running the multiconnection client...
The Transmission Control Protocol (TCP):
Is reliable: packets dropped in the network are detected and retransmitted by the sender.
Has in-order data delivery: data is read by your application in the order it was written by the sender