swiftsocketszeromqmulticastpgm-protocol

Why doesn't SwiftyZeroMQ support epgm:// and pgm:// transport-classes?


We currently want a way to pass data between devices with sockets so we used ZeroMQ on our server-side with a python script and everything seems to be working. Our protocol address currently is epgm://224.0.0.1:28650, However, we need to communicate with the python script so we decided to use this Swift library. Currently, I'm directly using the library from this repository and it seems to be using ZeroMQ library version 4.2 with patch level .2. Then, using this function, I'm checking whether or not the library has the .pgm protocol which my app reports that there it doesn't support it.

Although the library has this function to check whether or not it supports a certain protocol, I'm unable to find ANYTHING on google regarding how I would get the library to support the pgm protocol.

After looking through the original swift library, I was able to find zmq.h which, from what I can tell is what the swift library is using as it's ZMQ library. So, after discovering this, I attempted to recompile libzmq with the "--with-pgm" build option that we used to fix the issue on PyZMQ. However, I haven't really had much luck with this and I'm not even sure this is how I'm supposed to proceed. I'm currently at a loss and any help would be appreciated. Thanks.

Here's the Swift code that we're currently using:

import SwiftyZeroMQ5

class communicationClass{
   var context: SwiftyZeroMQ.Context?;
   var subscriber: SwiftyZeroMQ5.SwiftyZeroMQ.Socket?;

   init(){
      do{
         context = try SwiftyZeroMQ.Context();
         subscriber = try context?.socket(.subscribe);
         try subscriber?.connect("epgm://224.0.0.1:28650");
      }
      catch{
         print("error - \(error)")
      }
   }
}

Here's the error that it outputs: error - Protocol not supported


Solution

  • So, due to the lack of support of EPGM and PGM, we have decided to use raw UDP with ZeroMQ's dish/radio draft apis. These draft apis are supposed to replace EPGM and PGM but they're still in development. The apis work for our use case but it may vary depending on your use case.

    EDIT:

    So, there's a better answer to this question. The reason why SwiftyZeroMQ (at least my version) doesn't support the EPGM and PGM protocols is that you need to compile ZMQ yourself with the openpgm option.