Requirements
- Source code must be in the C/C++/Java programming language.
- The program must run on UTD lab machines (dc01, dc02, , dc45).
- You will need to know thread and socket programming and its APIs for the language you choose. It can beassumed that each process (server/client) is running on a single machine (dcXY). Please get familiar with basic UNIX commands to run your program on dcXY and UNIX/Linux system calls for directory and file operations. Project Description
In this project, you will use a socket connection to emulate communication between two network-connected computers, say C1 and C2, and implement the following:
- C2 has a local directory D1 with two text files F1 and F2.
- C1 has no such directory.
- C2 communicates with C1 to make a copy of D1 and all its contents at C1. As a consequence, now there are two replicas of directory D1 on different machines.
As you do not have access to two different file systems, you will achieve the desired outcome as follows:
- First create a subdirectory named D1 in your UTD home directory.
- Establish a VPN connection with UTD, and then log into two of the dcXY machines mentioned above. One of them will act as C1 and another as C2. Ideally, you would have two separate terminal windows, one in which you are logged into C1 and another in which you are logged into C2. You should have access to your UTD home directory on these machines.
- Launch a socket server program that you will write as part of this project on C1. Now, C1 will be listening for incoming connection requests.
- Next, launch the socket client program, also written by you as part of this project, on C2.
- Have the client running on C2 establish a reliable socket connection (TCP) with the server running on C1.
- Once the connection is established, have C2 send a message to C1 to create a directory D1copy.
- On receiving the request from C2, the server running on C1 should create a subdirectory D1copy in the home directory and send an acknowledgment to C2.
- Next C2 should send a message to C1 to create the first file named F1.
- C1 must create a file named F1 in subdirectory D1copy and acknowledge the successful creation of the file.
- C2 should read and send contents of file F1 to C2 in successive messages of size 256 bytes (or remaining size of the file when you get near the end of the file).
- C1 should append the file contents received from C2 into file F1 in subdirectory D1copy.
- When all contents of file F1 have been successfully sent by C2 and copied by C1, C2 should send a message indicating end of file, and C1 should respond with a message indicating successful creation of the file in subdirectory D1copy.
- Repeat the steps described above to also copy file F2 from subdirectory D1 to D1copy.
- Have C2 send a message indicating end of session to C1, close the socket connection and terminate.
- Have C1 also close the connection and terminate on receiving the end of session message from C2.
When your processes terminate at both the machines, you should have two subdirectories in your UTD home directory, names D1 and D1copy with identical contents.
Reviews
There are no reviews yet.