Web Server/WebServer.py
def start_server(server_port, server_address):
    """Create a socket and wait for TCP connection at port [serverPort].

    The server is created as a multithreaded server and has a capacity of
    handling multiple concurrent connections.

    :param server_port: Configurable port, defined as an optional argument.
    """
    print("you can test the web server by accessing: ", end="")
    # For test
    print("http://" + server_address + ":" + str(server_port) + "/hello.html")
    print('Wait for TCP clients...')
    # 1. Create server socket
    server_socket = socket(AF_INET, SOCK_STREAM) #IPv4.
    # 2. Bind the server socket to server address and server port.
    server_socket.bind(("", server_port))
    # 3. Continuously listen for connections to server socket.
    server_socket.listen(5)
    while True:
        # 4. When a connection is accepted, call handleRequest function,
        # passing new connection socket
        connection_socket, (client_ip, client_port) = server_socket.accept()
        # Run multithreaded method
        start_new_thread(handle_request, (connection_socket, client_ip, client_port))
    # 5. Close server socket.
    server_socket.close()
Create a socket and wait for TCP connection at port [serverPort].

    The server is created as a multithreaded server and has a capacity of
    handling multiple concurrent connections.

    :param server_port: Configurable port, defined as an optional argument.
    
Create a socket and wait for TCP connection at port [serverPort].
The server is created as a multithreaded server and has a capacity of
handling multiple concurrent connections.
Create a socket and wait for TCP connection at port [ serverPort ] . The server is created as a multithreaded server and has a capacity of handling multiple concurrent connections .
def start_server(server_port, server_address):
    print("you can test the web server by accessing: ", end="")
    print("http://" + server_address + ":" + str(server_port) + "/hello.html")
    print('Wait for TCP clients...')
    server_socket = socket(AF_INET, SOCK_STREAM) 
    server_socket.bind(("", server_port))
    server_socket.listen(5)
    while True:
        connection_socket, (client_ip, client_port) = server_socket.accept()
        start_new_thread(handle_request, (connection_socket, client_ip, client_port))
    server_socket.close()
def start_server ( server_port , server_address ) : print ( "you can test the web server by accessing: " , end = "" ) print ( "http://" + server_address + ":" + str ( server_port ) + "/hello.html" ) print ( 'Wait for TCP clients...' ) server_socket = socket ( AF_INET , SOCK_STREAM ) server_socket . bind ( ( "" , server_port ) ) server_socket . listen ( 5 ) while True : connection_socket , ( client_ip , client_port ) = server_socket . accept ( ) start_new_thread ( handle_request , ( connection_socket , client_ip , client_port ) ) server_socket . close ( )
Create a socket and wait for TCP connection at port [serverPort].
Create a socket and wait for TCP connection at port [ serverPort ] .
"""Create a socket and wait for TCP connection at port [serverPort].

    The server is created as a multithreaded server and has a capacity of
    handling multiple concurrent connections.

    :param server_port: Configurable port, defined as an optional argument.
    """ # For test # 1. Create server socket #IPv4. # 2. Bind the server socket to server address and server port. # 3. Continuously listen for connections to server socket. # 4. When a connection is accepted, call handleRequest function, # passing new connection socket # Run multithreaded method # 5. Close server socket.
server_port
Configurable port, defined as an optional argument.
Configurable port defined as an optional argument .
server_address