Python code:
import zmq
import sys
port ="5555"
print("Connecting to hello world server…")
context = zmq.Context()
socket = context.socket(zmq.REQ) # Socket to talk to server
socket.connect("tcp://localhost:%s"%port)
while(1): # Do requests,
try: # waiting each time for a response
message = socket.recv()
print(message)
except:
pass
MQL4 code:
#include <Zmq/Zmq.mqh>
Context context("helloworld");
Socket socket(context,ZMQ_REP);
socket.bind("tcp://*:5555");
ZmqMsg request;
ZmqMsg reply("Trade was executed");
socket.send(reply);
Print("Feedback: Trade was executed");
an infinite loop occurs when I want to send data from MQL4 to the Python programming language as above Python cannot receive message data through the port