Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!elroy.jpl.nasa.gov!decwrl!fernwood!portal!gdc!nms!bergquis From: bergquis@nms.gdc.portal.com (Brett Bergquist) Newsgroups: comp.lang.c Subject: Re: Sending struct through DGRAM socket Message-ID: <228@wimpy.nms.gdc.portal.com> Date: 19 Apr 91 23:21:39 GMT References: <1991Apr18.174104.27409@decuac.dec.com> Distribution: na Organization: General DataComm, Middlebury CT Lines: 19 mjr@hussar.dco.dec.com (Marcus J. Ranum) writes: > greg@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@nms.gdc.portal.com or ...!portal!gdc!nms!bergquis