<p>I use RCF with boost.serialization (why use RCF's copy when we already use the original?) It works OK, but when an exception is thrown in the server, it's not passed correctly to the client. Instead, I get an RCF::SerializationException quoting an <code>archive_exception</code> saying "class name too long". When I change the protocol to BsText, the exceptions is "unregistered class". When I change the protocol to SfBinary, it works.
I've registered RemoteException on both server and client like this:</p>

<pre><code>BOOST_CLASS_VERSION(RCF::RemoteException, 0)
BOOST_CLASS_EXPORT(RCF::RemoteException)
</code></pre>

<p>I even tried serializing and deserializing a <code>boost::shared_ptr&lt;RCF::RemoteException&gt;</code> in the same test, and it works.</p>

<p>So how can I make RCF pass exceptions correctly without resorting to SF?</p>

[{'answer_id': 85626, 'author': 'gbjbaanb', 'author_id': 13744, 'author_profile': 'https://Stackoverflow.com/users/13744', 'pm_score': 0, 'selected': False, 'text': '<p>According to Jarl it works, check <a href="http://www.codeproject.com/KB/threads/Rcf_Ipc_For_Cpp.aspx?fid=248794&amp;df=90&amp;mpp=25&amp;noise=3&amp;sort=Position&amp;view=Quick&amp;fr=101&amp;select=2365783" rel="nofollow noreferrer">codeproject</a> for a question and answer with sample code:</p>\n'}, {'answer_id': 132553, 'author': 'Lev', 'author_id': 7224, 'author_profile': 'https://Stackoverflow.com/users/7224', 'pm_score': 3, 'selected': True, 'text': '<p>Here\'s a patch given by Jarl at <a href="http://www.codeproject.com/KB/threads/Rcf_Ipc_For_Cpp.aspx?msg=2739150#xx2730536xx" rel="nofollow noreferrer">CodeProject</a>:</p>\n\n<p>In RcfServer.cpp, before the line where RcfServer::handleSession() is defined (around line 792), insert the following code:</p>\n\n<pre><code>void serialize(SerializationProtocolOut &amp; out, const RemoteException &amp; e)\n{\n      serialize(out, std::auto_ptr&lt;RemoteException&gt;(new RemoteException(e)));\n}\n</code></pre>\n\n<p>And in Marshal.cpp, around line 37, replace this line:</p>\n\n<pre><code>ar &amp; boost::serialization::make_nvp("Dummy", apt.get());\n</code></pre>\n\n<p>, with</p>\n\n<pre><code>T *pt = apt.get();\nar &amp; boost::serialization::make_nvp("Dummy", pt);\n</code></pre>\n'}]
['https://Stackoverflow.com/questions/62810', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/7224/']