Sending struct through DGRAM socket

Marcus J. Ranum mjr at hussar.dco.dec.com
Fri Apr 19 03:41:04 AEST 1991


greg at 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.



More information about the Comp.lang.c mailing list