A connection socket is the server-side endpoint created for one client after accept returns. Unlike the listening server socket, it carries communication with that client: data can be read from it and written to it. section 3.1
A blocking server obtains a connection socket in this sequence:
- Create, bind, and start listening on the server socket. section 3.1
- Call accept; it waits until a client connects, then returns the connection socket and client address. section 3.1
- Use the returned socket to communicate with that client. section 3.1
Accepting one client
connection, client_address = server_socket.accept()\nprint(f'I got a connection from {client_address}!') section 3.1
Figure 3.1 A client connects to our server socket. The server then creates a new socket to communicate with the client.
Shows the listening server socket creating a separate socket for communication with the connected client. section 3.1
