Montana Tech of The University of Montana
Computer Science & Software Engineering

CSCI 466
Networks
Fall 2013



PROGRAM #4

The goal of this assignment is to learn to make a multi-threaded TCP server in Python. You will also gain experience designing your own protocol to meet a set of requirements.


Overview
You are building a file storage server that allows clients to store and retrieve files from a directory on a server (similar to a simplified version of FTP). The server is connection-oriented with clients needing to authenticate via a password. The server needs to support multiple clients who may be storing and retrieving large files all at the same time. Thus your server must be multi-threaded. For simplicity, you can assume all files live in the same directory as the client and server program. You can also assume clients will avoid accessing the same filename at the same time.

The exact protocol you implement is up to you, but your program should meet the requirements detailed below. Your software should be robust to incorrect input from the user. In particular, your client and server should not crash, even if: We suggest you use TCP and base the "command-and-control" part of your communication around sending lines of text terminated by \n. Remember that TCP is just a stream of bytes! You cannot rely on send() or recv() returning the same number of bytes as the other side of the connection. You should first study our multi-threaded client/server that upper cases lines of text: TCPClientMulti.py TCPServerMulti.py

Client requirements: Server requirements:
Submission. Submit your programs FileClient.py and FileServer.py via Moodle. Be sure each submitted source file has the required header with your name, username, and a description of the program. Programs should use descriptive variable names and appropriate levels of commenting (explain at a high-level the goal of different sections of code).

Page last updated: November 12, 2013