Server socket methods

In a client-server architecture, there is a central server that provides services to a set of machines that connect. These are the main methods we can use from the point of view of the server:

  • socket.bind(address): This method allows us to connect the address with the socket, with the requirement that the socket must be open before establishing the connection with the address
  • socket.listen(count): This method accepts as a parameter the maximum number of connections from clients and starts the TCP listener for incoming connections
  • socket.accept(): This method allows us to accept connections from the client. This method returns two values: client_socket and client address. client_socket is a new socket object used to ...

Get Mastering Python for Networking and Security now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.