1

I am currently trying to set up pub/sub messaging between two Android devices (within Unity specifically) but have found that for some reason, only the connect()-method works on Android devices while "binding" does not. Thus, having one Android device successfully "connecting" to the address, the other Android device, in turn, needs to be "bound" to the address but as explained, this does not work for some reason on Android. The messaging works perfectly fine when going from PC to Android (either device) but once built on the Android devices, the bind connection fails. Current setup:

Pub:

void Awake()
{
    AsyncIO.ForceDotNet.Force();
    pub = new PublisherSocket();
    pub.Options.SendHighWatermark = 10;
    pub.Bind($"tcp://{IP}:5556");
}
void Update()
{
    pub.SendFrame(camData);
}

Sub:

void Awake()
{
    AsyncIO.ForceDotNet.Force();
    subSocket = new SubscriberSocket();
    subSocket.Connect($"tcp://{IP}:5556");
    subSocket.Subscribe("");
}
void Update()
{
    subSocket.TryReceiveFrameBytes(System.TimeSpan.Zero, out message);
}
  • Welcome to StackOverflow, Andrew, there are some rules here. Would you kindly update you post, to specify which of the many Transport-classes available do you actually try to use `{ tcp:// | pgm:// | epgm:// | vmci:// | tipc:// | norm:// | ? }` on which addresses / port-numbers and the **M**inimum **C**omplete **V**erifiable **E**xample of the code for the System-under-Test, that represents the problem, that's fair when you ask the Community to help you, isn't it? – user3666197 Dec 16 '20 at 10:00
  • Great to see the update. You might like in the nearer or farther future to use an explicit message be delivered to a selected StackOverflow member of choice, by adding an @-decorated nickname into the text, as nobody else beyond {Q|A}-author gets notified otherwise @andrew-chilicki ;o) As far as the code was added, what *`errno`* error-results does the `.Bind()`-method actually produced ( be 'em inspected as a POSIX or the ZeroMQ-shaded one )? Also a StackOverflow good engineering practice is to post versions (URL-referenced) of the ZeroMQ, language port/binding type & version, as these matter – user3666197 Dec 16 '20 at 16:58

0 Answers0