|
Project Description
Write a client/server application implementing a shared directory at the server. The server keeps
a directory of files (a folder) where the users can upload or download files. When the user connects
to the server, he/she selects either to download a file or to upload one. If the user wants to
download a file, the server will show a list of the files found in the shared directory, and the user will
select one of them and download it. If the user selects to upload a file, the user will select the file
and send it to the server, the server will store the file in the shared directory and make it available to
the later download requests.
Server Details:
• The Server keeps all the shared files in a regular folder (i.e. the Administrator of the server
can open this folder and view its contents as any other windows folder)
• The Server keeps a list of all the users allowed to use the system, only users found in this list
can upload or download files.
• The server provides a facility to add new users.
• The server keeps a list of files in the shared folder, each entry of this list contains (basically)
the name of the file, the name of the user who added it, and date and time when the file was
loaded.
• Any file to be uploaded to the server should not have the same name as any file already
found in the shared directory.
• Any shared file could be deleted only by the user who uploaded it.
• TCP connection is used in all the communications except in exchanging files, for file
exchange (uploading or downloading) UDP is used. Although UDP is used in files transfers,
the transmission should be reliable. (Hint: Acknowledge every packet received by the
destination)
• All the lists used by the server should be saved to the hard disk for later executions.
• The server serves one request at a time, consequently no threading is required.
Client Details:
• When the client program is executed for the first time, it should be configured with server IP
address and port number. These settings should be saved for future executions. Also the
user should be able to change these settings at any time.
Implementation Details:
• You can use any programming language and any IDE tools you like.
• The code should be fully Object Oriented.
• You will be in need to initiate and maintain two connections, one using UDP for file
transfers and TCP for all other communications.
Typical Communication Scenarios (Happy Day Scenarios):
- Connecting to the server and downloading a file.
TCP Connection
Establishment
Connect as
(User Name and
Password)
Check User
Name and
Password
Ask for User
Name and
Password
Valid ,What do
you want?
Ask the User.
User selects to
download. Download
Prepare a List of
shared files
Files List
User Selects
File
File Name
Read the File
and split it into
packets
Packet 1
Ack 1
Save Packet
to file
Prepare the
Second Packet
Packet 2
...
Ack 2
Save Packet
to file
UDP Connection
Establishment
TCP
Connection
UDP Connection
- Connecting to the server and uploading a file.
TCP Connection
Establishment
Connect as
(User Name and
Password)
Check User
Name and
Password
Ask for User
Name and
Password
Valid ,What do
you want?
Ask the User.
User selects a
file to Upload. Upload: File
Name.
Check If File
Name Exist.
OK,Start
Uploading Read the File
and split it into
packets
Packet 1
Ack 1
Save Packet to
file
Prepare the
Second Packet
Packet 2
...
Ack 2
UDP Connection
Establishment
TCP Connection
UDP Connection
Prepare the First
Packet
Save Packet to
file
Prepare the Last
Packet
Last Packet
Save Packet to
file, create an
entry in the
files list
- Connecting to the server and deleting a file.
J.U.S.T
|
|
|
|