407 1of3 server.py - server script import socket def...

This preview shows page 1 out of 1 page.

# server script import socket def server_program(): # get the hostname host = socket.gethostname() # initiate port no above 1024 port = 5000 # get instance server_socket = socket.socket() # look closely - the bind() function takes tuple as argument # bind host address and port together server_socket.bind((host, port)) # configure how many clients the server can listen to simultaneously server_socket.listen(2) # accept new connection conn, address = server_socket.accept()

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture