[Mono-dev] .Net TCP/IP remoting with unmanaged C++ endpoint?

Marek Habersack grendel at caudium.net
Thu Jun 29 11:17:04 EDT 2006

Hash: SHA1

Jonathan Pryor wrote:
> On Wed, 2006-06-28 at 12:47 +0200, Marek Habersack wrote:
>>   I've just been asked a question whether it would be possible to create a
>> TCP/IP{ (native .NET binary protocol) connection between an unmanaged server
>> written in C++ and a managed client.
> Your subject says "TCP/IP remoting", while the body says "TCP/IP
> (native .NET binary protocol), so I'll assume you actually mean
> Remoting.
Indeed, that's what I had in mind.

> You can't use Remoting from a purely unmanaged server, as Remoting
> assumes a .NET execution environment (marshaling object references,
> object types, class data member names...).  You _might_ be able to fake
> enough of the protocol to do it purely unmanaged, but it would likely be
> _very_ brittle.
> Remoting -- and any other technology which assumes that the same type
> can be loaded & used on both sides of the connection -- is not suitable
> for cross-runtime uses (e.g. .NET -> Java/C/C++/Python/...).
> Which leaves you with looking for something that _is_ useful for
> cross-runtime uses, of which there are several:
>   - Corba.NET (which uses CORBA as the communications protocol)
>   - DBus (if both processes will be on the same machine)
>   - SOAP
>   - ZeroC/ICE (which you already mentioned)
>   - Some home-grown protocol
> SOAP is likely to be the most mature, but since it isn't a binary
> protocol there may be some concerns about its performance.
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
I guess what I really meant when asking the question (and it might be my
misunderstanding of how Remoting works) is that it would be great if I could
open a tcp/ip connection between the client-server and use the Remoting binary
protocol for invoking code on the other end. I assumed that Remoting is a form
of a more advanced/specialized SOAP application that, among others, uses a
binary protocol for communication between endpoints. If my idea of Remoting was
true, using unmanaged C++ endpoint would be a matter of decoding the binary
protocol stream and invoking the unmanaged code in a similar way as when you'd
invoke a method on a SOAP/XML-RPC/CORBA server written in unmanaged C++, where
the request is sent in a form that's language-agnostic (like XML/IDL in the
above cases). Well, it seems that my idea of Remoting was indeed incorrect :)

thanks a lot, best regards


Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


More information about the Mono-devel-list mailing list