You are here:

C++/Object stream

Advertisement


Question
Hi.. We r implementing one network protcol in c++ , we are using java code as reference.. In java we are able to stream class object, Primitive data types other than byte stream using java api . Please let me know the alternative way in c++ to perform this task.. if possible please provide related link ..

Answer
to perform network i/o, you could use the socket++ library.
it has the same interface as that of the iostream library, so using it to perform type-safe input output should be intuitive.
home page: http://www.linuxhacker.at/socketxx.
download: http://www.linuxhacker.at/socketxx/download

to stream objects of user defined types, you could use the Boost.serialization library
documentation link:  http://www.boost.org/doc/libs/1_36_0/libs/serialization/doc/index.html
download: http://sourceforge.net/project/showfiles.php?group_id=7586&package_id=8041&relea

these libraries can be used in conjunction.

C++

All Answers


Answers by Expert:


Ask Experts

Volunteer


vijayan

Expertise

my primary areas of interest are generic and template metaprogramming, STL, algorithms, design patterns and c++11. i would not answer questions about gui and web programming.

Experience

about 15 years or so

Education/Credentials
post graduate engineer

©2016 About.com. All rights reserved.