Home / Essays / Java Socket Programming

Java Socket Programming

Java Socket Programming
Understand how socket works. Explore socket programming. Have a deep understanding about TCP and UDP protocol in terms of transferring file precisely and efficiently. Learn what a stream is and the differences between input and output stream. Understand how to attach a stream to a device/socket. Exercise how to design and implement a protocol which controls the communication between server and client side.
You are required to make a program to transfer the same file from client side to server side for one hundred times with TCP/UDP protocol. Every time as long as the file is transferred, compare with the stored standard file to see they are the same. If the received file is the same as the stored file, it means the file is transferred correctly, otherwise incorrectly. Count the transferring error rate (number of times incorrect file received at server side out of one hundred times) for TCP/UDP to see its (UDP or TCP) reliability. At the meantime, count the time in mili-second cost to transfer the same file for hundred times with TCP/UDP.
Detailed Requirements:
1. You need to make two programs including one client side (C), one server side (S).
2. You can finish either TCP or UDP code.
3. Please use Javalanguages. Using any other languages will result in zero of your project.
4. Your client and server side program must run in two different hosts, respectively. The two hosts must be two physical computers. The two hosts must connect through the Internet or local area network.
5. You client side program sends the same file (see the sample text format file) to the server side for one hundred times.
6. You server side program receives the file. Every time as long as the file is completely received, please compare with the sample file (stored at server side in advance) to see if they are the same. If the received file is different from the stored file, count one time incorrect transfer.
7. Use TCP/UDP to finish file transferring for one hundred times, count the number of time that incurs incorrect transfer, and count the average time used forone hundred times transferring.
8. You must test and explain your client and server side programs and demonstrate that your programs meet the requirements. In your demonstration, you must clearly show the IP addresses of the two machines/hosts (using ipconfig in windows and ifconfig in Unix or Linux), respectively. You also need to display the file in both sides
9. Zip your server and client side source code (no class code) and submit it through D2L dropbox. If you have special compiling and linking commands used, please attach a “readme.txt” file to let me know how to compile your source code. All the above files must be zipped into one submission file.
Grading Rubric:
1. Demonstrate (10 points) that your program works correctly. (40 points)
2. TCP/UDP server and client side programs. (30 points)
3. Testing Results. (20 points)

Testing Table (one hundred times average)
File Size Time used (mili-second)
In one LAN Time used (mili-second)
In different LANs or ASs
1K size Text file
100K size Text file
Submission through D2L Dropbox:

1. Your read me.txt file if you have one.
2. Client side source code for UDP/TCP.
3. Server side source code for UDP/TCP.

FOR YOUR ASSIGNMENTS TO BE DONE AT A CHEAPER PRICE PLACE THIS ORDER OR A SIMILAR ORDER WITH US NOW :)

Leave a Reply

WPMessenger