Sending struct through DGRAM socket
Brett Bergquist
bergquis at nms.gdc.portal.com
Sat Apr 20 09:21:39 AEST 1991
mjr at hussar.dco.dec.com (Marcus J. Ranum) writes:
> greg at carnivore.tamu.edu (Greg Economides) writes:
>
> There is no "clean" way to do it - take a look at Sun's XDR
> protocol (if you're on a 386i it should be in your doc kit) and all
> the RPC/XDR goo. Basically, it involves writing a function that will
> convert your structure into a padded, folded, spindled, and mutilated
> format that will transport over the net - and then you decode it on
> the other side.
I am currently using XDR in this fashion to send a structure with embedded
pointers to other structures across an unix pipe. To do so, I created a
RPCGEN description of the message and used "rpcgen" to create the header
and XDR encoding/decoding module. I works pretty good, and the RPCGEN
description file makes for good documentation too.--
Brett M. Bergquist, Principal Engineer | "Remind me" ... "to write an
General DataComm, Inc., | "article on the compulsive reading
Middlebury, CT 06762 | of news." - Stranger in a Strange Land
Email: bergquis at nms.gdc.portal.com or ...!portal!gdc!nms!bergquis
More information about the Comp.lang.c
mailing list