Description
Project Requirements
In Part 4 of the project, you must complete the fta_client.c and fta_server.c programs. You can find the source code in the attached zip file below. The source modules will compile and run, but the program functionality is incomplete. To complete these programs, you should implement the following requirements:
- The source file name and the destination file name must be given to the client program as arguments.
- The client program must transfer the destination file name to the server program before the data transfer.
- The FTA client and server programs should only use the SWAP and SDP APIs.
- The FTA client and server programs should print your name and student number.
Note
In this assignment you will implement file functions to read and write the input file and the output file respectively. You may wish to review the document entitled “Project Work: Getting Started” and the practice program you were asked to complete at the beginning of the project work: file_copy.c. These activities will help refresh your knowledge of file I/O in the C programming language.
Compile and Test the FTA Client and Server Programs
You will need to test your programs on two terminals, one terminal for the server and another terminal for the client. The port number and IP address for the client should be specified as command line arguments, as well as the names of the input and output file. If the output file does not exist, your program should create the output file.
- # Compile the FTA server program$ gcc fta_server.c swap_server.c sdp.c checksum.c -o fta_server
- # Run the SWAP server program from the command line; specify the port number on the command line./fta_server 8899
- # Compile the SWAP client program$ gcc fta_client.c swap_client.c sdp.c checksum.c -o fta_client
- # Run the client program from the command line; specify the IP address, port number and input-filename../fta_client 127.0.0.1 8899 input-filename
Note
input-filename is a text file that you create to send to the server ; a simple text file with 5 lines is sufficient.
- If there are no errors in your implementation of FTA, then fta_client will transfer the input file to fta_server. The fta_server will write the contents of the file sent by fta_client to the output file. For the sake of simplicity, you may hardcode the name of the output file in fta_server.c
- After you copy a file using your FTA application, compare the input file to the output file o see if the destination file was copied correctly. Use the diff command to compare the two files.