Sending objects across platforms: herewith are some very handy classes for moving your objects around a network

Fabio Lopiano · C/C++ users journal · 2001

The number of applications written for communicating across multiple computing platforms and environments on a network continues to grow. A common problem in developing client/server, e-commerce, distributed, and other networked applications is the conversion of data from host to network format and vice versa. The non-standard (but commonly available) functions ntoh and hton help to deal with this marshalling problem. Unfortunately, these functions can be tedious to invoke for every data member of every object (and its subobjects) that need to be transmitted or received.This article demonstrates a technique to bridge the host/network/host chasm, which uses hton and ntoh in a more elegant way. It also shows how this technique can be extended to develop a framework for the rapid implementation of complex communication protocols.

Read the paper · More papers on PaperTik