Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sockets Protocol

Status
Not open for further replies.

fatcodeguy

Programmer
Feb 25, 2002
281
CA
Hi,

When using sockets, do the built in functions do all the handshaking/bit checking stuff? If i send an object through an object output stream, do both client and server sockets perform any checksums on transfered bits? Is all this user handled?

Thanks!!
 
What do you mean by "checksum" ? Checksums are generally used in files whereby a known algorithm is performed on the data, and compared with an actual checksum number, usually at the end of the file to see if the data is uncorrupted.

Socket and ServerSocket classes are just a basic implementation of the TCP/IP protocol - so yes "handshaking" as you put it is done (in as much as a network level connection between client and server is made, ready for recv() and send() methods can be used). Its up to you to "check" the data though ...

ObjectOutputStream is a wrapper around an IO stream (be that over a network socket handle, or a file handle; well, in UNIX, ALL sockets/files are file handles, but thats another story) that converts a class object into a byte array. When you use ObjectInputStream, yes, there is some checking - for example that the first 8 bytes begin with the characters CAFE.

Click here to learn Ways to help with Tsunami Relief
--------------------------------------------------
Free Database Connection Pooling Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top