dingmaotu / mql-zmq

ZMQ binding for the MQL language (both 32bit MT4 and 64bit MT5)
Apache License 2.0
553 stars 301 forks source link

Context creation hangs #68

Closed tarunprakash closed 4 months ago

tarunprakash commented 8 months ago

I am trying to run a simple Hello World test that pushes a message to the client, but it is getting stuck. Below is my code:

#property strict

#include <Zmq/Zmq.mqh>

void OnInit() {
   Print("Server has started");
   Context context("helloworld");
   Socket pushSocket(context,ZMQ_PUSH);
   pushSocket.bind("tcp://*:5555");
   Print("Server is ready");

   Print("Sending message to client…");
   ZmqMsg message("Hello world");
   pushSocket.send(message, true);
   Print("Message sent");
}

void OnDeinit(const int reason) {
   Print("Server has finished");
}

I've narrowed it down, and it seems to be hanging on this line: Context context("helloworld");

I am running this as a script on MT4 on MacOS, and I have tried running it with both the precompiled MT4 DLLs and also the VC2010 DLLs.

Any idea why this might be happening?

tarunprakash commented 8 months ago

Some more details:

I am stumped, this is driving me crazy!!

Let me know if you have any idea why this might he happening, anything helps

dingmaotu commented 8 months ago

It has been reported that the DLLs does not work on m1 mac. I don't have access to an m1 mac, so it won't be solved in the near future.