On Wed, Mar 17, 2004 at 04:09:15AM +0000, RAHUL CHOUBE wrote:

>     i am facing a problem in sending a nested
> structure over the network using a socket. I have sent
> a data buffer on the same socket and it is working
> fine.

In general, you can't send binary structures over a network connection
and expect them to remain intact (not even un-nested structures).
Differences in endianness, compilers, compiler versions, and even
compiler optimizations mean that the binary layout of the structure is
not guaranteed to be the same on both sides.

You need to serialize the structure and send the serialized stream. On
the other side, you unserialize the stream and populate the
structure. You will have to design the communication protocol so that
both sides know what each byte in the stream means.

-- 
Dave Carrigan
Seattle, WA, USA
[EMAIL PROTECTED] | http://www.rudedog.org/ | ICQ:161669680
UNIX-Apache-Perl-Linux-Firewalls-LDAP-C-C++-DNS-PalmOS-PostgreSQL-MySQL

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to