Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!decwrl!pa.dec.com!decuac!hussar.dco.dec.com!mjr From: mjr@hussar.dco.dec.com (Marcus J. Ranum) Newsgroups: comp.lang.c Subject: Re: Sending struct through DGRAM socket Message-ID: <1991Apr18.174104.27409@decuac.dec.com> Date: 18 Apr 91 17:41:04 GMT References: <14918@helios.TAMU.EDU> Distribution: na Organization: Digital Equipment Corp., Washington Ultrix Resource Center Lines: 14 greg@carnivore.tamu.edu (Greg Economides) writes: >Is there a quick/clean way to translate a struct into a character stream >(and then a way to get the struct back) so that it can be sent using these >functions? 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. mjr.