Question: Requirements: Two Python files: server.py client.py server.py: Required functionality: Create a socket, bind a socket, and listen to for a connection. Accept incoming connections from

Requirements:
Two Python files:
server.py
client.py
server.py:
Required functionality:
Create a socket, bind a socket, and listen to for a connection.
Accept incoming connections from the client
Receive data from the client
Save the received data from the client to a local file
Send a response back to the client. If data was successfully received and saved, send a confirmation message. If it wasn't, send an error
message to the client.
client.py
Required functionality:
The client will need to make a connection to the server using the specified host and port defined in server.py
Prompt the user to enter a simple text message.
Once the user submits their message, the client needs to sent it to the server.
Once the server receives and processes the message, the client needs to receive the server response and display it to the user, either if the
message was successfully sent or if there was an error.
Environment Variables:
Both scripts will retrieve the os environment variables for the hostname and port number from the os. These variables are HOST and PORT
respectively.
Hardcoded values for the hostname and port number will not be accepted.
Requirements: Two Python files: server.py

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!