As announced in the class, each student is assigned a project as follows: You wi
ID: 664224 • Letter: A
Question
As announced in the class, each student is assigned a project as follows:
You will implement an application that can transfer a file from one computer to another.
The details are as follows:
SENDING SIDE:
1. When you run an application, there will be a prompt to enter file name. The file could be in the directory from where you run your application or could be in any other directory. So you will give a full path for the file name.
2. Your application checks if the file exists. If not then it prints an error and asks the user to enter the file name again.
3. If the file exists, the application asks for the destination IP address. You enter a valid IP address.
4 Prepare to send the file:
a. decide whether to send file using UDP or TCP - Your report should indicate on what basis you did the selection.
b. Open the appropriate socket.
c. Divide the file into smaller Parts (message/chunks....).
d. Send the file in pieces
e. After the complete file is sent, wit for acknowledgment from the receiving side.
f. When acknowledgment is received, terminate the application.
RECEIVING SIDE:
1. Run the application, it is waiting for TCP connection or for UDP messages.
2. If TCP connection is requested from the sending side, open the connection then wait for TCP messages.
3. Receive the messages (TCP or UDP).
4. The messages contain parts of the file (that was sent).
5. Re-assemble the file.
6. After receipt of complete file, send an acknowledgment to the sending side.
7. Terminate the application.
You will submit the code.
You will capture screen shot of running your application on sending and receiving side
You will capture screen shot of wireshark running on sending or receiving side - IDENTIFY and HIGHLIGT your message.
Write a report on what you did.
Finally you will demo the sending and receipt of files to me or the TA. The demo must show file using UDP AND TCP.
We may ask you to send any type of file - PDF/JPEG/DOC/txt etc.
Explanation / Answer
client side
main.java
public class Main {
/**
* @param args the command line arguments
*/
public static void main(String[] args)
{
new Client();
}
}
client.java
server side
main.java
server.java
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.