Using ZeroMQ in Xamarin

2020-04-12 02:54发布

问题:

I have an application composed from a server and a client.

The Server is C/C++ application, and the client is a cross-platform Xamarin application that target Windows, Android and iOS .

The Server part and the Client part communicate using ZeroMQ messages.

I tried the current c# implementation like NetMQ and clrzmq, but they cannot be used in Xamarin.

Did you know the simplest way to use ZeroMQ in Xamarin?

回答1:

I fear there is no straightforward solution atm. Not until the NetMQ author will take all the way down to making the library portable. If you need a quick workaround you could try to make an HTTP tunnel for your data i.e. transfer your data from Xamarin client to IIS server via HTTP and there unpack NetMQ packages from HTTP packets and resend those to your C/C++ ZeroMQ server.

As an alternative you could try this: Socket.IO Client .NET or this: Sockets Plugin for Xamarin.

I do not have any comparison of their performance to ZeroMQ and NetMQ in particular though.