pythonfix-protocol

[python][fix-api][simplefix] how to stay in a session? None error


I use simplefix and socket python modules. After I send logon and market data request I see market data that I need for around 5 minutes and then I gets an error: 'none'

how to stay in a session? Here is what I sending and my responce:

sending:

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))

s.sendall(logon())
print(parse(s.recv(4096), 50))

s.sendall(market_data())
while True:
    print(s.recv(4096))

responce:

8=FIX.4.4|9=106|35=A|34=1|49=CSERVER|50=QUOTE|52=20230128-21:45:28.927|56=demo.roboforex.6183532|57=any|98=0|108=30|141=Y|10=228
b'8=FIX.4.4\x019=135\x0135=W\x0134=2\x0149=CSERVER\x0150=QUOTE\x0152=20230128-21:45:28.988\x0156=demo.roboforex.6183532\x0157=any\x0155=1\x01268=2\x01269=0\x01270=1.08677\x01269=1\x01270=1.08678\x0110=075\x01'
b'8=FIX.4.4\x019=88\x0135=0\x0134=3\x0149=CSERVER\x0150=QUOTE\x0152=20230128-21:45:59.917\x0156=demo.roboforex.6183532\x0157=any\x0110=107\x01'
b'8=FIX.4.4\x019=97\x0135=1\x0134=4\x0149=CSERVER\x0150=QUOTE\x0152=20230128-21:46:14.917\x0156=demo.roboforex.6183532\x0157=any\x01112=TEST\x0110=119\x01'
none
none
none
none
none
none
none
none
none
none
none
none
none
none
none
none
none
none
none
none
none
none

Solution

  • You are expected to regularly send heartbeats to keep the connection alive (unless you are sending messages).

    In the logon message it is seen in tag 108 that you want to send heartbeats every 30 seconds. So maybe you should do that.