Computer Science Homework Help

Computer Science Homework Help. client and chat server in python

  1. comment explaining each line of source code
  • You are to create a chat system. In particular, you will create a chat client and a chat server. Notably, the client and the server must be separate programs. Your system will perform as follows:
    1. The server will listen for connections from clients.
    2. Once a client is connected, it can send messages to the server. It will also receive from the server all messages sent from the other connected clients.
    3. NOTE: The first message sent by the client must be the name of the user, in order for the server to forward the name of the user with each messenge sent.
    4. Messages must be provided to the client using standard input.
    5. Immediately after receiving a message, the server must forward the message and the name of the user who sent the message to all connected clients, except for the client that sent the message. DO NOT SEND THE MESSAGE BACK TO THE ORIGINATING CLIENT!
    6. The format of the combined name and message includes a colon, followed by a single space, immediately after the name of the sender; the message follows. Hence, the format can be represented as follows:
      <sender name>: <message>
      
    7. Once it receives a message, which now includes the name of the sender, the client will write the message to standard output.
    8. The client must write each message on its own line of output.
    9. When a client closes its socket, the server will remove that client from its list, but the server will continue to run and the other connected clients will be able to continue exchanging messages. Additionally, new clients will be able to connect and exchange messages.
  • Usage

    • Server:
      • Python:
        $> python ChatServer.py <port number>
    • Client:
      • Python:
        $> python ChatClient.py <port number>

Computer Science Homework Help

 
"Our Prices Start at $11.99. As Our First Client, Use Coupon Code GET15 to claim 15% Discount This Month!!"