[Mono-dev] .Net TCP/IP remoting with unmanaged C++ endpoint?
Brian Crowell
mono-devel at fluggo.com
Thu Jun 29 12:36:57 EDT 2006
Marek Habersack wrote:
> That's the whole problem about SOAP/XML-RPC (which I considered as well). The
> communication is going to be done over slow links (most probably on-demand
> dial-up connections) between embedded devices and a central server, so both the
> volume of data sent and the size of code running on the embedded devices are
> very important. The embedded devices are the ones that would run the C++
> software and the server would run a Mono application. CORBA seems to heavy
> weight for the purpose, too, even though ACE runs on devices with tight memory.
> Therefore, it seems, I will need to come up with a proprietary communication
> protocol.
We had similar issues with the remoting stack. We wanted a compact, but
portable, binary protocol.
What we ended up doing was creating an RPC format that transitioned data in a
fashion similar to that of the Torque Network Library
<http://opentnl.sourceforge.net/doxydocs/>. Data is packed like structures based
on order and known types in a recursive pass, which makes the codec both fast
and simple and doesn't require the entire .NET Framework to work.
There are plenty of caveats, though: Your structures must be trees, they have to
be typed public (although a class trying to marshal itself can easily create a
marshallable instance, similar to a SerializationInfo instance), and you have to
know all the types ahead of time. But since you're creating a C++ endpoint as
well, I'm sure those aren't major setbacks.
I've mulled over open-sourcing that library. Would you be interested?
--Brian
More information about the Mono-devel-list
mailing list