ACE Tutorial 015
Building a protocol stream


In a typical client/server system you will be sending and receiving data. That's the whole point after all.

In the client/server tutorials that we've done so far it was just a matter of sending a buffer of data to the peer. This was done with the send*() and recv*() methods of the ACE_SOCK* objects.

In a more robust system, one might want to process the data before sending it to a peer and "unprocess" it after reading from a peer. These processing steps might include encryption, compression, applying checksums or any number of other actions.

In this tutorial a Protocol_Stream object is created to encrypt and compress* data being sent between peers. Both client and server applications are presented as well. I present the application level code first and then go into the details of the protocol stream and it's helper objects. If the stream stuff in the application logic is confusing then just read on by and come back to it after the later discussions.

Disclaimer:

Kirthika's abstract:

* Ok, I didn't really implement encryption objects. I'll leave that as a thought exercise!


[Tutorial Index] [Continue This Tutorial]