socket.create_server

socket.create_server(addr, family=AF_INET)

  • Creates a TCP service that is bound to address
  • This address takes the form of (host, port)
  • The functions returns a socket object
  • This function is typically used for testing with servers
  • The address family is AF_INET by default

Example of create_server

>>> import socket
>>> addr = ('', 8080)             # accept all interfaces
>>> s = socket.create_server(addr)  # listen on port 8080

References

Previous
Next

socket.create_connection

socket.getaddrinfo