Disconnection in less than a minute
Disconnection in less than a minute
27 Mar 2022, 22:03
Hello
I'm coding my own FIX API in C++, it's working more or less but I can't keep the connection alive, in less than one minute the server closes the connection and I get a broken pipe error.
I'm sending a heartbeat every ten seconds, also for each heartbeat from the server I send another one (not sure if I need to do it), also I respond with a heartbeat on each test request message (35=1).
I've been looking at the sample code and I find some inaccuracy with the documentation, for instance, TargetSubID(57) must be "QUOTE" or "TRADE" and SenderSubID(50) must be set to "Quote" if TargetSubID is equal to "QUOTE" (the same with a trade session?), but in the source code SenderSubID is set to the user name. I've tried with several values but I got the same result.
I'm just sending the login error, security list request, and heartbeats messages.
Here's the message log.
8=FIX.4.4|9=137|35=A|49=live.icmarkets.1051433|34=1|56=CSERVER|57=QUOTE|50=1051433|52=20220327-18:47:21.228|108=10|98=0|141=Y|553=1051433|554=*****|10=250|8=FIX.4.49=11035=A34=149=CSERVER50=QUOTE52=20220327-18:47:21.31256=live.icmarkets.105143357=105143398=0108=10141=Y10=216
OUT:
8=FIX.4.4|9=120|35=x|49=live.icmarkets.1051433|34=2|56=CSERVER|57=QUOTE|50=1051433|52=20220327-18:47:21.351|320=20220327184721676|559=0|10=032|
IN:
8=FIX.4.4|9=3328|35=y|34=2|49=CSERVER|50=QUOTE|52=20220327-18:47:21.385|56=live.icmarkets.1051433|57=1051433|320=20220327184721676|322=responce:20220327184721676|560=0|146=120|55=1024|1007=EURCZK|1008=3|55=1|1007=EURUSD|1008=5|55=1025|1007=NZDSGD|1008=4|55=2|1007=GBPUSD....
<removed, it was too long>
OUT:
8=FIX.4.4|9=139|35=V|49=live.icmarkets.1051433|34=3|56=CSERVER|57=QUOTE|50=1051433|52=20220327-18:47:22.420|262=1|263=1|264=1|267=2|269=0|269=1|146=1|55=1|10=230|
IN:
8=FIX.4.4|9=139|35=W|34=3|49=CSERVER|50=QUOTE|52=20220327-18:47:22.455|56=live.icmarkets.1051433|57=1051433|55=1|268=2|269=0|270=1.09834|269=1|270=1.09838|10=072|
OUT:
8=FIX.4.4|9=092|35=0|49=live.icmarkets.1051433|34=4|56=CSERVER|57=QUOTE|50=1051433|52=20220327-18:47:32.353|10=150|
IN:
8=FIX.4.4|9=92|35=0|34=4|49=CSERVER|50=QUOTE|52=20220327-18:47:32.699|56=live.icmarkets.1051433|57=1051433|10=115|
OUT:
8=FIX.4.4|9=096|35=0|49=live.icmarkets.1051433|34=5|56=CSERVER|57=QUOTE|50=1051433|52=20220327-18:47:32.821|10=155|
OUT:
8=FIX.4.4|9=092|35=0|49=live.icmarkets.1051433|34=6|56=CSERVER|57=QUOTE|50=1051433|52=20220327-18:47:42.353|10=153|
IN:
8=FIX.4.4|9=92|35=0|34=5|49=CSERVER|50=QUOTE|52=20220327-18:47:42.699|56=live.icmarkets.1051433|57=1051433|10=117|
OUT:
8=FIX.4.4|9=096|35=0|49=live.icmarkets.1051433|34=7|56=CSERVER|57=QUOTE|50=1051433|52=20220327-18:47:42.861|10=162|
OUT:
8=FIX.4.4|9=092|35=0|49=live.icmarkets.1051433|34=8|56=CSERVER|57=QUOTE|50=1051433|52=20220327-18:47:52.353|10=156|
IN:
8=FIX.4.4|9=92|35=0|34=6|49=CSERVER|50=QUOTE|52=20220327-18:47:52.699|56=live.icmarkets.1051433|57=1051433|10=119|
OUT:
8=FIX.4.4|9=092|35=0|49=live.icmarkets.1051433|34=9|56=CSERVER|57=QUOTE|50=1051433|52=20220327-18:47:53.514|10=157|
OUT:
8=FIX.4.4|9=093|35=0|49=live.icmarkets.1051433|34=10|56=CSERVER|57=QUOTE|50=1051433|52=20220327-18:48:02.353|10=194|
IN:
8=FIX.4.4|9=92|35=0|34=7|49=CSERVER|50=QUOTE|52=20220327-18:48:02.699|56=live.icmarkets.1051433|57=1051433|10=116|
OUT:
8=FIX.4.4|9=250|35=0|49=live.icmarkets.1051433|34=11|56=CSERVER|57=QUOTE|50=1051433|52=20220327-18:48:02.935|10=196|
OUT:
8=FIX.4.4|9=100|35=0|49=live.icmarkets.1051433|34=12|56=CSERVER|57=QUOTE|50=1051433|52=20220327-18:48:12.353|10=186|
IN:
8=FIX.4.4|9=92|35=0|34=8|49=CSERVER|50=QUOTE|52=20220327-18:48:12.699|56=live.icmarkets.1051433|57=1051433|10=118|
OUT:
8=FIX.4.4|9=250|35=0|49=live.icmarkets.1051433|34=13|56=CSERVER|57=QUOTE|50=1051433|52=20220327-18:48:12.869|10=205|
IN:
8=FIX.4.4|9=101|35=1|34=9|49=CSERVER|50=QUOTE|52=20220327-18:48:17.699|56=live.icmarkets.1051433|57=1051433|112=TEST|10=182|
OUT:
8=FIX.4.4|9=250|35=0|49=live.icmarkets.1051433|34=14|56=CSERVER|57=QUOTE|50=1051433|52=20220327-18:48:17.922|10=201|
OUT:
8=FIX.4.4|9=100|35=0|49=live.icmarkets.1051433|34=15|56=CSERVER|57=QUOTE|50=1051433|52=20220327-18:48:22.353|10=190|
Receive data error: End of file size: 0
Broken pipe
OUT:
8=FIX.4.4|9=100|35=0|49=live.icmarkets.1051433|34=16|56=CSERVER|57=QUOTE|50=1051433|52=20220327-18:48:32.353|10=192|
Replies
amusleh
28 Mar 2022, 14:13
RE:
swapd0 said:
The checksum is right or I won't be able to login, ask for the symbol list or subscribe to a symbol.
I'm on an OSX machine, and I don't code in Python.
Hi,
We can't develop a sample for all languages, you can run the Python sample on your OSX machine if you want to.
Or use the QuickFIX library: quickfix/quickfix: QuickFIX C++ Fix Engine Library (github.com)
@amusleh
amusleh
28 Mar 2022, 10:48
Hi,
The disconnection can happen due to several reasons, like incorrect check sum.
There is no issue on our side and I just tested our Python samples, it works fine.
Regarding configuration, here is a valid configuration for Quotes session:
{ "Host": "h51.p.ctrader.com", "Port": 5201, "Username": "account_number", "Password": "account_password", "BeginString": "FIX.4.4", "SenderCompID": "demo.icmarkets.account_number", "SenderSubID": "QUOTE", "TargetCompID": "cServer", "TargetSubID": "QUOTE", }
You can check our Python or QuickFIX .NET samples on Github.
@amusleh