c++ - Exceptions not passed correctly thru RCF (using Boost.Serialization) -


i use rcf boost.serialization (why use rcf's copy when use original?) works ok, when exception thrown in server, it's not passed correctly client. instead, rcf::serializationexception quoting archive_exception saying "class name long". when change protocol bstext, exceptions "unregistered class". when change protocol sfbinary, works. i've registered remoteexception on both server , client this:

boost_class_version(rcf::remoteexception, 0) boost_class_export(rcf::remoteexception) 

i tried serializing , deserializing boost::shared_ptr<rcf::remoteexception> in same test, , works.

so how can make rcf pass exceptions correctly without resorting sf?

here's patch given jarl @ codeproject:

in rcfserver.cpp, before line rcfserver::handlesession() defined (around line 792), insert following code:

void serialize(serializationprotocolout & out, const remoteexception & e) {       serialize(out, std::auto_ptr<remoteexception>(new remoteexception(e))); } 

and in marshal.cpp, around line 37, replace line:

ar & boost::serialization::make_nvp("dummy", apt.get()); 

, with

t *pt = apt.get(); ar & boost::serialization::make_nvp("dummy", pt); 

Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -