?
Solved

How can I pass object  through socket using c++

Posted on 2003-03-19
3
Medium Priority
?
589 Views
Last Modified: 2007-12-19
I am trying to pass the object ( for example image) through socket with c++. I know we can use  recv and send to pass the char* but I could find any function to pass the object or structure.

Thank you
0
Comment
Question by:philipli
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 1

Accepted Solution

by:
sparticus1701 earned 100 total points
ID: 8167361
Sockets are only capable of sending byte streams, hence the char*s.  If you want to send an object, what you need to do is have someway to serialize it's data into a byte stream, and send that.  Then on the other side, you'll want something that can create a new object with the serialized data.
0
 
LVL 5

Assisted Solution

by:isprabu
isprabu earned 100 total points
ID: 8173551
CORBA can be used to handle distributed objects (between client & servers). CORBA takes care of seriealising/marhsalling of objects across network (internally it uses tcp and hence sockets!) and at application level you don't have to worry about sending/packing/receiving/unpacking the objects. CORBA uses stub/proxy/IDL files for this.
In the NT world, DCOM is the preferred alternative for CORBA. because it is native to Windows and so give better performance.
Just for your info:
In the Java world, you can use RMI or EJB for sending objects across.
0
 

Expert Comment

by:CleanupPing
ID: 9447001
philipli:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Six Sigma Control Plans

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question