Client and server sockets

Write two programs, a client and a server, that implement file transfer through a network. Upon startup, the server should listen and wait for a client to connect to it. (20 pts) The client should connect to the server and then go into a loop. In this loop, the user should be able to type “get [file]”, “put [file]”, or “quit”.

• The first option should cause the server to send the bytes contained in the named file. The client should open a file locally with the same name and save the received bytes.

• The second option should work the same but in reverse, resulting in a copy of the file being saved at the server.

• The third option exits the client.

Both programs can be run on the same system and have their IPs and ports hard-coded, but they should run in separate directories so that file operations can be tested.

The client should report an appropriate error message if the requested file does not exist, or if it cannot connect to the server.

Order from us and get better grades. We are the service you have been looking for.