[Ilugc] Doubts on Sockets
- From: v_krishnakumar77"<v_krishnakumar77@xxxxxxxxxxxxxx (v_krishnakumar77)
- Date: Tue, 17 Dec 2002 16:06:33 +0530
"Prakash N" wrote:
I have a small doubt in Sockets..
Hmmm. Seems like its not a small doubt after all !
We use sockets for sending data accross the processes.
If the processes are running on the same machine consider using shared memory -
its much faster.
I am using a TCP socket for such communication.
I need to send one structure using Sockets.
Now please let me know how can I write my structure into the buffer(one of the
parameter of send System Call)
XDR (try googling for it) is a pretty good solution and its the underlying
encoding scheme in RPC.
CDR (google for the spec.) is a variant of XDR that is used in CORBA.
Another scheme is to use XML to encode structures. This is very simple to use
but carries a bit of baggage as it requires an XML parser. But it can be easily
debugged. IMO, its the simplest way to encode data.
For some testimonials, checkout http://www.xmlrpc.com
PS: apologies for the stupid ad below.
Get Your Private, Free E-mail from Indiatimes at http://email.indiatimes.com
Buy the best in Movies at http://www.videos.indiatimes.com
Now bid just 7 Days in Advance and get Huge Discounts on Indian Airlines
Flights. So log on to http://indianairlines.indiatimes.com and Bid Now
Other related posts: