Bitbucket is a code hosting site with unlimited public and private repositories. We're also free for small teams!

Close
AY2011/2012 Semester 2
CS2105 Programming Assignment Part 1
Chua Jie Sheng	A0073894N

the UDPFileClient send the file using the following procedure
1. retrieve the file bytes via streams
2. place into a 'unit' (something similar to packets)
3. calculate hash (SHA-1) on the bytes stored in the unit
4. send all the unit, one-by-one, waiting for ack after each unit sent
5. repeat 4 till all unit is sent

the UDPFileServer receive the file using the following procedure
1. receive each UDP packet
2. determine the 'client' (source IP address and source port)
3. check the hash of bytes[] if tally with the hash calculated at the sender (if incorrect, drop the packet)
4. place the packet into the a hashmap mapped to each client
5. check if the hashmap of that client contains all units required (i.e. all unit received)
6. if yes, retrieve all bytes[] and write into a filename specified by the client
7. repeat 1

Recent activity

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.