A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Sockets and Internet Protocols
Info on UDP checksums
Joined: Apr 03, 2005
Jun 09, 2006 17:33:00
Can anyone steer me to easy to follow information on doing checksums and in particular with UDP?
Joined: Dec 31, 2004
Jun 09, 2006 20:39:00
Well, you can calculate a checksum using two different classes in Java. You can use the
Both of them implement
Now, when it comes to UDP Datgram packets. You can update the Checksum until you have sent or received all the data, and then calculate the checksum.
Somewhat like this:
//declare this or the Adler32 implementation Checksum checksum = new CRC32(); //update the checksum as many times as packets you receive checksum.update(packet.getData(),0,packet.getLength()); long value = checksum.getValue(); //this is the real checksum
Good luck, comrade!
[ June 09, 2006: Message edited by: Edwin Dalorzo ]
I agree. Here's the link:
subject: Info on UDP checksums
Taming the network problem
UDP SOCKET IN TWO SEPARETE TERMINAL
Comparing two Files
Chat systems based on TCP & UDP
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014