Question: In this project, you are required to write two programs (a client and a server) and transfer a file from the client to the server

In this project, you are required to write two programs (a client and a server) and transfer a file from the client to the server using TCP sockets. The server program will receive the file sent from the client, process the request and send the result back to the client program. Finally, the client program receives the result from the server and then display it to the screen.

Detailed Requirements:

You need to write two programs using the Python language, one client (named as client_YourLastName.py) and one server program (named as server_YourLastName.py).

You client program MUST send the file (send1.txt) to the server program. You server program receives the file, process it, and then sends the processing results back to the client program.

You client program receives the result from the server and then displays it on screen.

The file send1.txt contains a list of positive integers separated by a comma.

How does the server program process the received file send1.txt?

Assume that this file contains an ordered list of positive integers such as

<5, 4, 3, 2, 1, 100, 27, 18, 10, 5, 6, 1, 9, 4, 2, 3>.

Your server program has to find the largest integer in the list that is the sum of another two numbers after that integer. For the above list, the largest integer in the list that satisfies this condition is 27 as 27 = 18 + 9. Your server program MUST find the largest integer in the list that satisfies the condition and then sends it back to the client. Your client program displays the result on the screen.

Required outputs:

Your server program MUST output all the integers in red that satisfy the condition

Your client program ONLY display the largest one among them (sent from the server program)

How to run your programs?

The first time you run your programs, your client program uses the input file send1.txt. Take two screenshots, one for your server program and the other for your client program.

Then you run your programs for the second time, your client program uses the input file send2.txt. Take two screenshots as above.

Finally, you run your programs for the third time, your client program uses the input file send3.txt. Take two screenshots as above.

send1.txt

5, 4, 33, 2, 12, 13, 10, 2, 6, 1, 4

send2.txt

5, 4, 33, 2, 12, 100, 200, 13, 10, 6, 41, 5, 4, 34, 2, 1, 101, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 300, 13, 10, 6, 4, 200, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 13, 10, 6, 4, 5, 4, 33, 2, 12, 100, 400, 13, 10, 6, 41, 5, 4, 34, 2, 1, 102, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 13, 10, 6, 4, 103, 13, 10, 116, 4, 5, 4, 3, 2, 1, 100, 500, 13, 10, 6, 4, 5, 4, 33, 2, 12, 100, 200, 13, 10, 6, 41, 5, 4, 34, 2, 1, 101, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 300, 13, 10, 6, 4, 200, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 13, 10, 6, 4, 5, 4, 33, 2, 12, 100, 400, 13, 10, 6, 41, 5, 4, 34, 2, 1, 102, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 13, 10, 6, 4, 103, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 500, 13, 10, 6, 4, 5, 4, 33, 2, 12, 100, 200, 13, 10, 6, 41, 5, 4, 34, 2, 1, 101, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 300, 13, 10, 6, 4, 200, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 13, 10, 6, 4, 5, 4, 33, 2, 12, 100, 400, 13, 10, 6, 41, 5, 4, 34, 2, 1, 102, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 13, 10, 6, 4, 103, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 500, 13, 10, 6, 4, 5, 4, 33, 2, 12, 100, 200, 13, 10, 6, 41, 5, 4, 34, 2, 1, 101, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 300, 13, 10, 6, 4, 200, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 13, 10, 6, 4, 5, 4, 33, 2, 12, 100, 400, 13, 10, 6, 41, 5, 4, 34, 2, 1, 102, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 13, 10, 6, 4, 103, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 500, 13, 10, 6, 4

send3.txt

5, 4, 123456, 33, 2, 12, 45678, 100, 200, 13, 10, 6, 41, 5, 4, 34, 2, 1, 101, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 300, 13, 10, 6, 4, 200, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 13, 10, 6, 4, 5, 4, 33, 2, 12, 100, 400, 13, 10, 6, 41, 5, 4, 34, 2, 1, 102, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 13, 10, 6, 4, 103, 13, 10, 116, 4, 5, 4, 3, 2, 1, 100, 500, 13, 10, 6, 4, 5, 4, 33, 2, 12, 100, 200, 13, 10, 6, 41, 5, 4, 34, 2, 1, 101, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 300, 13, 10, 6, 4, 200, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 13, 10, 6, 4, 5, 4, 33, 2, 12, 100, 400, 13, 10, 6, 41, 5, 4, 34, 2, 1, 102, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 13, 10, 6, 4, 103, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 500, 13, 10, 6, 4, 5, 4, 33, 2, 12, 100, 200, 13, 10, 6, 41, 5, 4, 34, 2, 1, 101, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 300, 13, 10, 6, 4, 200, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 13, 10, 6, 4, 5, 4, 33, 2, 12, 100, 400, 13, 10, 6, 41, 5, 4, 34, 2, 1, 102, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 13, 10, 6, 4, 103, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 500, 13, 10, 6, 4, 5, 4, 33, 2, 12, 100, 200, 13, 10, 6, 41, 5, 4, 34, 2, 1, 101, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 300, 13, 10, 6, 4, 200, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 13, 10, 6, 4, 5, 4, 33, 2, 12, 100, 400, 13, 10, 6, 41, 5, 4, 34, 2, 1, 102, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 13, 10, 6, 4, 103, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 500, 13, 10, 6, 4, 1000, 1, 600, 1, 3, 400, 5, 4, 33, 2, 12, 100, 200, 13, 10, 6, 41, 5, 4, 34, 2, 1, 101, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 300, 13, 10, 6, 4, 200, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 13, 10, 6, 4, 5, 4, 33, 2, 12, 100, 400, 13, 10, 6, 41, 5, 4, 34, 2, 1, 102, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 13, 10, 6, 4, 103, 13, 10, 116, 4, 5, 4, 3, 2, 1, 100, 500, 13, 10, 6, 4, 5, 4, 33, 2, 12, 100, 200, 13, 10, 6, 41, 5, 4, 34, 2, 1, 101, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 300, 13, 10, 6, 4, 200, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 13, 10, 6, 4, 5, 4, 33, 2, 12, 100, 400, 13, 10, 6, 41, 5, 4, 34, 2, 1, 102, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 13, 10, 6, 4, 103, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 500, 13, 10, 6, 4, 5, 4, 33, 2, 12, 100, 200, 13, 10, 6, 41, 5, 4, 34, 2, 1, 101, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 300, 13, 10, 6, 4, 200, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 13, 10, 6, 4, 5, 4, 33, 2, 12, 100, 400, 13, 10, 6, 41, 5, 4, 34, 2, 1, 102, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 13, 10, 6, 4, 103, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 500, 13, 10, 6, 4, 5, 4, 33, 2, 12, 100, 200, 13, 10, 6, 41, 5, 4, 34, 2, 1, 101, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 300, 13, 10, 6, 4, 200, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 13, 10, 6, 4, 5, 4, 33, 2, 12, 100, 400, 13, 10, 6, 41, 5, 4, 34, 2, 1, 102, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 13, 10, 6, 4, 103, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 500, 13, 10, 6, 4, 1005, 1, 600, 1, 3, 400, 5, 4, 123456, 33, 2, 12, 45678, 100, 200, 13, 10, 6, 41, 5, 4, 34, 2, 1, 101, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 300, 13, 10, 6, 4, 200, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 13, 10, 6, 4, 5, 4, 33, 2, 12, 100, 400, 13, 10, 6, 41, 5, 4, 34, 2, 1, 102, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 13, 10, 6, 4, 103, 13, 10, 116, 4, 5, 4, 3, 2, 1, 100, 500, 13, 10, 6, 4, 5, 4, 33, 2, 12, 100, 200, 13, 10, 6, 41, 5, 4, 34, 2, 1, 101, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 300, 13, 10, 6, 4, 200, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 13, 10, 6, 4, 5, 4, 33, 2, 12, 100, 400, 13, 10, 6, 41, 5, 4, 34, 2, 1, 102, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 13, 10, 6, 4, 103, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 500, 13, 10, 6, 4, 5, 4, 33, 2, 12, 100, 200, 13, 10, 6, 41, 5, 4, 34, 2, 1, 101, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 300, 13, 10, 6, 4, 200, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 13, 10, 6, 4, 5, 4, 33, 2, 12, 100, 400, 13, 10, 6, 41, 5, 4, 34, 2, 1, 102, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 13, 10, 6, 4, 103, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 500, 13, 10, 6, 4, 5, 4, 33, 2, 12, 100, 200, 13, 10, 6, 41, 5, 4, 34, 2, 1, 101, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 300, 13, 10, 6, 4, 200, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 13, 10, 6, 4, 5, 4, 33, 2, 12, 100, 400, 13, 10, 6, 41, 5, 4, 34, 2, 1, 102, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 13, 10, 6, 4, 103, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 500, 13, 10, 6, 4, 1000, 1, 600, 1, 3, 400, 5, 4, 33, 2, 12, 100, 200, 13, 10, 6, 41, 5, 4, 34, 2, 1, 101, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 300, 13, 10, 6, 4, 200, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 13, 10, 6, 4, 5, 4, 33, 2, 12, 100, 400, 13, 10, 6, 41, 5, 4, 34, 2, 1, 102, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 13, 10, 6, 4, 103, 13, 10, 116, 4, 5, 4, 3, 2, 1, 100, 500, 13, 10, 6, 4, 5, 4, 33, 2, 12, 100, 200, 13, 10, 6, 41, 5, 4, 34, 2, 1, 101, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 300, 13, 10, 6, 4, 200, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 13, 10, 6, 4, 5, 4, 33, 2, 12, 100, 602, 400, 13, 10, 6, 41, 5, 4, 34, 2, 1, 102, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 13, 10, 6, 4, 103, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 500, 13, 10, 6, 4, 5, 4, 33, 2, 12, 100, 200, 13, 10, 6, 41, 5, 4, 34, 2, 1, 101, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 300, 13, 10, 6, 4, 200, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 13, 10, 6, 4, 5, 4, 33, 2, 12, 100, 400, 13, 10, 6, 41, 5, 4, 34, 2, 1, 102, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 13, 10, 6, 4, 103, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 500, 13, 10, 6, 4, 5, 4, 33, 2, 12, 100, 200, 13, 10, 6, 41, 5, 4, 34, 2, 1, 101, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 300, 13, 10, 6, 4, 200, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 13, 10, 6, 4, 5, 4, 33, 2, 12, 100, 400, 13, 10, 6, 41, 5, 4, 34, 2, 1, 102, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 13, 10, 6, 4, 103, 13, 10, 6, 4, 5, 4, 3, 2, 1, 100, 500, 13, 10, 6, 4, 1000, 1, 1, 3, 403, 4, 7, 9

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 Databases Questions!