how i pass object or structure using tcp/ip protocol


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers how i pass object or structure using tcp/ip protocol
# 1  
Old 08-21-2007
how i pass object or structure using tcp/ip protocol

suppose i want to pass object or structure using TCP/IP protocol
(using socket) then what are special steps required for passing the object from client to server and vice versa
Regards,
Amit
# 2  
Old 08-21-2007
The exact mechanism to take depends on your environment, programming language, and how you would like it done. The basic idea is to encode the structure or object you want to pass as a bytestream (a step called serialization), then on the other end you simply do the reverse to reconstruct it from the bytestream (deserialization). The variation is whether you want to do the serialization manually in your own format or you entrust this to a library or similar implementing such a mechanism that does that for you.

Say, for Java-Java there is an ObjectOutputStream you can use directly. For C and RPC you can use XDR (External Data Representation - Wikipedia, the free encyclopedia). Or, you can use XML or JSON that are increasingly popular.
# 3  
Old 08-21-2007
Quote:
Originally Posted by cbkihong
The exact mechanism to take depends on your environment, programming language, and how you would like it done. The basic idea is to encode the structure or object you want to pass as a bytestream (a step called serialization), then on the other end you simply do the reverse to reconstruct it from the bytestream (deserialization). The variation is whether you want to do the serialization manually in your own format or you entrust this to a library or similar implementing such a mechanism that does that for you.

Say, for Java-Java there is an ObjectOutputStream you can use directly. For C and RPC you can use XDR (External Data Representation - Wikipedia, the free encyclopedia). Or, you can use XML or JSON that are increasingly popular.
i m using the c++ language on linux platform.
now using tcp/ip how i send object from client to server and vice-versa
amit
# 4  
Old 08-21-2007
Quote:
Originally Posted by amitpansuria
i m using the c++ language on linux platform.
You could look at the various C++ CORBA ORBs that are about.

The Free CORBA page
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Solaris

Installing TCP-MUX protocol socket help required.

I been looking for a good guide or some help on how to install and setup TCP-MUX protocol socket on my Solaris 7 servers. Can anyone point me in right direction of help me ? Thanks (5 Replies)
Discussion started by: Wpgn
5 Replies

2. Solaris

Too much TCP retransmitted and TCP duplicate on server Oracle Solaris 10

I have problem with oracle solaris 10 running on oracle sparc T4-2 server. Os information: 5.10 Generic_150400-03 sun4v sparc sun4v Output from tcpstat.d script TCP bytes: out outRetrans in inDup inUnorder 6833763 7300 98884 0... (2 Replies)
Discussion started by: insatiable1610
2 Replies

3. Programming

How to initialize an object with another object of different class?

How to initialize an object of class say "A", with an object of type say "B". The following code give the error message "error: conversion from âAâ to non-scalar type âBâ requested" #include <iostream> using namespace std; class B; class A{ public: A() { cout <<"\nA()" << endl; } ... (1 Reply)
Discussion started by: techmonk
1 Replies

4. IP Networking

How to i get to the TCP/IP internet protocol menu in Windows 7?

In Windows Vista all that one needs to do is right click your active network and select properties to get the (TCP/IP) internet protocol menu, but i cannot reach that menu in Windows 7. This is the menu that i am trying to reach in Windows 7 : i can't seem to find... (2 Replies)
Discussion started by: Anna Hussie
2 Replies

5. UNIX for Dummies Questions & Answers

Object reference not set to an instance of an object

I am new to PHP and UNIX. I am using Apache to do my testing on a Windows Vista machine. I am getting this error when I am trying to connect to a web service. I did a search and did not see any posts that pertain to this. Here is my function: <?php function TRECSend($a, $b, $c, $d,... (0 Replies)
Discussion started by: EddiRae
0 Replies

6. Programming

Search attributes in one structure using the values from another structure

Hello Groups I am trying to find out ways of comparing a value from a 'c' structure to a value in another 'C' structure. the 'C' structure can be a List or liked list as it contains lot many records. if we loop it in both the structures it is going to consume time. I am looking for a simple... (3 Replies)
Discussion started by: dhanamurthy
3 Replies

7. UNIX for Advanced & Expert Users

MV files from one directory structure(multiple level) to other directory structure

Hi, I am trying to write a script that will move all the files from source directory structure(multiple levels might exist) to destination directory structure. If a sub folder is source doesnot exist in destination then I have to skip and goto next level. I also need to delete the files in... (4 Replies)
Discussion started by: srmadab
4 Replies

8. IP Networking

protocol

iam doing a research on WAN so pliz any body can give me or tell me where i would find communication protocol map..thats all 7 layers..OIS MODEL (1 Reply)
Discussion started by: ravineelkumar
1 Replies

9. UNIX for Dummies Questions & Answers

Copying a Directory Structure to a new structure

Hi all Is it possible to copy a structure of a directory only. e.g. I have a file with the following entries that is a result of a find :- /dir1/dir2/file.dbf /dir1/dir2/dir3/file1.dbf /dir1/file.dbf I want to copy these to a directory and keep the structure however starting at a new dir... (8 Replies)
Discussion started by: jhansrod
8 Replies
Login or Register to Ask a Question