Sending Objects Across the Network Using Sockets

You saw earlier how easy it is to create a client Socket and a ServerSocket and then send data between the two using sockets. What about sending objects between the two using sockets? Can it be done? Fortunately, it can, and it's almost as easy as sending primitive data. There is one thing that hasn't been discussed yet and that's an application rotocol.

An application protocol is the understood messaging structure that goes on between the client and server sides. From the server side standpoint, the client can send all the data that it wants, but unless the server knows what to do with it ahead of time, the act is pretty much meaningless. There has to be an agreed upon structure in the communication. ...

Get Special Edition Using Java 2 Standard Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.