Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This assignment must be done in Python 3 In this assignment, you will write a client and server application similar to FTP. The client connects

This assignment must be done in Python 3

In this assignment, you will write a client and server application similar to FTP. The client connects to the server and can down-load any file accessible to the server application. Any number of files can be down-loaded and no access control is performed.

More specifically, the client initiates a control connection to the server port (the default port is #5000 if a port number is not given). All commands are sent over this connection. The client supported commands are: list, get, and exit. The client will request a list of file names that are available on the server, (list of files in the same directory as the server.py file). The client can get a file by entering get filename.ext. When the client requests to down-load a file using get, the server sends the requested file back. After the client receives the file and saves it to disk, the user should be able to issue another list, get or exit command.

Additional requirements:

The client will need to verify that it received the entire file. (Therefore, the server must let the client know the file size before sending it).

The server message will be the in the following format:

sending filename.ext size (The size in bytes)

All connections must be properly closed when the client is finished, i.e. sends: exit.

The server must be able to handle simultaneous requests from multiple clients. (Threads can be used)

The client may ask for a file that the server cannot provide, so the client must be able to respond appropriately with an error message (since the client can obtain a list of files). (No crashing!)

Do not assume a file size, i.e. send the file in chunks of 1024 bytes.

Do not assume localhost.

The client should put the received file in the same directory as the client.py file (The client.py file could be on a different host).

Test your client and server with other students to see if you have made any assumptions.

If your program does not completely work, it should not crash, the user should receive the message Not Implemented Yet.

Do not hardcode any port numbers or IP addresses for the client. I should be able to provide the server and port number for the client side using command line arguments. Example: client.py 129.32.56.2 12001

Do no hardcode any port numbers for the server. To run the program, I will type python3 server.py port_number (or python3 server.py) and python3 client.py ipaddress port_number

Dont do anything that would make your code specific to an operating system, such as windows pathnames, or Unix pathnames.

Submission Instructions:

Turn in 3 files server.py, client.py and README.txt, zipped with your last_name.zip as the title of the assignment. DO NOT ADD ANYTHING ELSE TO THE ZIP FILE NAME.

All functions and variables should have meaningful names.

Use meaningful comments for functions

I will place 3 files, .txt, .jpg, .png in the server directory when I unzip your submission. I will run the server and clients on different machines, so test your applications similarly. (Use Pickle to send objects back and forth, such as lists and non-string objects.)

I will initiate several of your clients at the same time. You should test this also.

The README.txt should:

Let me know if your program is not fully implemented.

Identify whether you developed the application on a Windows, MAC or Unix machine.

Include specific instructions to type on the command line to run your program.

Forewarn of any implementation issues

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design And Implementation

Authors: Shouhong Wang, Hai Wang

1st Edition

1612330150, 978-1612330150

More Books

Students also viewed these Databases questions