I'm trying to send a message to the API of a server in order to get a response. I'm using the following code:
import socket
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server_address = ('h68.p.ctrader.com',5211)
sock.connect(server_address)
message = "8=FIX.4.4|9=87|35=0|49=theBroker.12345|56=cServer|57=QUOTE|50=BVN's Message|34=1|52=20180322-21:26:01|10=101"
sock.send(bytes(message,'utf-8'))
data = sock.recv(3)
print(data)
sock.close()
However, when you run it, the message is sent to the server, but at the time of receiving the response from the server [data = sock.recv (3)], the program does not continue. It keeps the cursor blinking, as if it were in an infinite loop. What is the likely cause of this problem? Was it the script? The message sent to the server? The server itself? How do I fix the problem?
Note: This message is in a format required by the server API, which consists of "tag"="value" | "tag"="value" | "tag"="value" ...