Can you explain how you are trying to write to the socket and how you 
are receiving?

If you use write or send you just supply a pointer to the value and a 
length to write, viz - written = write(sokfd, (char *)fptr, 8); where 
fptr is a pointer to your floating point number.

We use Sqlite embedded as RPCs but actually encapsulate the data as XML 
and send floating point or other numbers in text form so that there can 
never be byte ordering or format issues.  SQL also maps quite nicely to 
XML.  The downside is the complexity of the XML parser at the receive end.

Alex Katebi wrote:
> I am trying to implement remote procedure calls (RPC) for SQLite API to be
> used in my application.
> In particular sqlite3_column_double( ) returns a floating point double.
> How can I write this double value into a TCP socket?
> I have tried writing 8 bytes as integer values but the received valued at
> the other end of the socket is incorrect.
> I don't have a lot of experience with real numbers. Can someone help?
> 
> Thanks,
> -Alex
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to