passing floats in inet socket-based IPC

Jun Lu luj at gus16.ecn.purdue.edu
Mon Nov 26 15:14:59 AEST 1990


Is there a quick/neat way to passing floats in inet socket-based IPC, just
like we "routinely" do for passing ints on "popoular" architectures( with
just some hton or ntoh conversions) ?

The two processes, as indicated by "inet", may run on two different
plateforms.

One very portable and safe way for passing floats is, as I can see, is to
convert floats to ascii representations before sending them 
across the network and on the other end convert the ascii strings back to
floats using strtod().  But the disadvantages are that this consumes more
message space than necessary and also incurs the overhead of converisons
between ascii and floats.

Are the any better alternatives ?

Thanks for any info/pointers in advance.
--
-- Jun Lu                          Internet:luj at ecn.purdue.edu          --
-- Aeronautics & Astronautics      Bitnet:  luj%ecn.purdue.edu at purccvm  --
-- Purdue University		   UUCP:    pur-ee!luj                  -- 
-- W. Lafayette, IN 47907          Phone:317-494-9410  Fax:317-494-0307 --



More information about the Comp.unix.questions mailing list