Topics
Replies
slukk200
19 Jan 2022, 13:55
RE: RE: FIX API crash(usually after 1-20 minutes) : An existing connection was forcibly closed by the remote host
amusleh said:
slukk200 said:
Hi Amusleh,
I have registered 2 live accounts. For one(Pepperstone) it has been running for 10 hours without any problem, but for the otherone (ICMarkets) it keeps disconnecting. I have tried your console app again with the config file you provided and it disonnected after 3 minutes. (The two apps have been running parallel so I don't think this is an internet problem)
Is there someone here at Spotware who could take a look at it?
Or should I contact the broker?
Hi,
I tested again on a IC Market demo account today for 2 hours and 200 symbols, I didn't faced any issue.
If we can't replicate the issue how can we fix it? I have tested it and it works fine.
I'm Spotware community developer.
Hi Almulesh,
I have never said that the issue is on your side. I just would like to know the reason why your server closed the connection. Is there a way someone could take a look at it?
Unfortunately I recieve no incoming message about the reason why it is terminated.
It could be a hearbeat issue or something else, I don't know.
@slukk200
slukk200
18 Jan 2022, 19:09
FIX API crash(usually after 1-20 minutes) : An existing connection was forcibly closed by the remote host
Hi Amusleh,
I have registered 2 live accounts. For one(Pepperstone) it has been running for 10 hours without any problem, but for the otherone (ICMarkets) it keeps disconnecting. I have tried your console app again with the config file you provided and it disonnected after 3 minutes. (The two apps have been running parallel so I don't think this is an internet problem)
Is there someone here at Spotware who could take a look at it?
Or should I contact the broker?
@slukk200
slukk200
12 Jan 2022, 16:02
RE:
I tried your application. It was running perfectly from 2022-01-12 12:29:44.2000861 to 2022-01-12 13:32:24.2037626 but then it got disconnected, so it worked perfectly for a bit more than an hour only. (Username and password was hardcoded.)
This is the config file I was using:
[DEFAULT]
BeginString=FIX.4.4
ConnectionType=initiator
HeartBtInt=10
ReconnectInterval=900000
StartTime=00:00:00
EndTime=23:59:59
StartDay=Sun
EndDay=Sat
DataDictionary=./FIX44-CSERVER.xml
FileStorePath=.\FIXLogs\
FileLogPath=.\Logs\
ScreenLogShowEvents=Y
TimeZone=Central Europe Standard Time
UseLocalTime=N
MillisecondsInTimeStamp=Y
ValidateFieldsHaveValues=N
[SESSION]
SessionQualifier=TRADE
SenderCompID=demo.ctrader.3441945
TargetCompID=cServer
SenderSubID=APP_TRADE_SESSION
TargetSubID=TRADE
ResetOnLogon=Y
SocketConnectHost=h28.p.ctrader.com
SocketConnectPort=5202
[SESSION]
SessionQualifier=QUOTES
SenderCompID=demo.ctrader.3441945
TargetCompID=cServer
SenderSubID=APP_QUOTE_SESSION
TargetSubID=QUOTE
ResetOnLogon=Y
SocketConnectHost=h28.p.ctrader.com
SocketConnectPort=5201
@slukk200
slukk200
11 Jan 2022, 13:00
( Updated at: 11 Jan 2022, 14:14 )
I just tried it with 5 symbols, and it has been working perfectly for 2 hours so far.
-Is there a limitation on how many symbols can I connect to or how many messages can I recieve?
-Or maybe there are some limitations of the demo accounts?
-Should connect to one symbol per session only and have 80 different sessions?
-ReconnectInterval=900000, I see that people usually set it to around 20. Could this be the problem?
Unfortunately I couldn't find anything about limitations in the document, so if anyone knows anything about it, please share.
@slukk200
slukk200
10 Jan 2022, 17:44
RE:
amusleh said:
Hi,
I just tested with our QuickFIX console sample and it didn't got disconnected at all after waiting for more than an hour.
I just tried it again. It took me maybe a minute to get disconnected. I have attached my logs. If you see something weird, please let me know. Again, I am connected to around 80 symbols and use only one session for quotes and one for trades. How many symbols did you connect?
These are the last few messages before it disconnected.
8=FIX.4.49=15335=W34=307149=cServer50=QUOTE52=20220110-15:08:59.47956=demo.ctrader.344194557=APP_QUOTE_SESSION55=52268=2269=0270=15.70375269=1270=15.7084310=072
8=FIX.4.49=14935=W34=307249=cServer50=QUOTE52=20220110-15:08:59.48456=demo.ctrader.344194557=APP_QUOTE_SESSION55=15268=2269=0270=90.976269=1270=90.98610=144
8=FIX.4.49=15135=W34=307349=cServer50=QUOTE52=20220110-15:08:59.50256=demo.ctrader.344194557=APP_QUOTE_SESSION55=41268=2269=0270=1795.19269=1270=1795.3110=219
8=FIX.4.49=15435=W34=307449=cServer50=QUOTE52=20220110-15:08:59.50756=demo.ctrader.344194557=APP_QUOTE_SESSION55=22312268=2269=0270=1588.09269=1270=1588.2410=122
8=FIX.4.49=14935=W34=307549=cServer50=QUOTE52=20220110-15:08:59.52956=demo.ctrader.344194557=APP_QUOTE_SESSION55=54268=2269=0270=7.4381269=1270=7.439710=140
8=FIX.4.49=14735=W34=307649=cServer50=QUOTE52=20220110-15:08:59.56256=demo.ctrader.344194557=APP_QUOTE_SESSION55=42268=2269=0270=22.38269=1270=22.3910=015
8=FIX.4.49=15035=W34=307749=cServer50=QUOTE52=20220110-15:08:59.57556=demo.ctrader.344194557=APP_QUOTE_SESSION55=4268=2269=0270=115.318269=1270=115.32110=157
8=FIX.4.49=14935=W34=307849=cServer50=QUOTE52=20220110-15:08:59.58656=demo.ctrader.344194557=APP_QUOTE_SESSION55=7268=2269=0270=156.203269=1270=156.2110=123
8=FIX.4.49=14935=W34=307949=cServer50=QUOTE52=20220110-15:08:59.59256=demo.ctrader.344194557=APP_QUOTE_SESSION55=22268=2269=0270=8.8943269=1270=8.895310=151
8=FIX.4.49=15135=W34=308049=cServer50=QUOTE52=20220110-15:08:59.59256=demo.ctrader.344194557=APP_QUOTE_SESSION55=59268=2269=0270=12.0482269=1270=12.049710=217
8=FIX.4.49=15035=W34=308149=cServer50=QUOTE52=20220110-15:08:59.59556=demo.ctrader.344194557=APP_QUOTE_SESSION55=2268=2269=0270=1.35455269=1270=1.3545710=168
8=FIX.4.49=15135=W34=308249=cServer50=QUOTE52=20220110-15:08:59.60356=demo.ctrader.344194557=APP_QUOTE_SESSION55=57268=2269=0270=10.0535269=1270=10.055910=204
8=FIX.4.49=14935=W34=308349=cServer50=QUOTE52=20220110-15:08:59.60356=demo.ctrader.344194557=APP_QUOTE_SESSION55=8268=2269=0270=1.26748269=1270=1.267510=127
8=FIX.4.49=15235=W34=308449=cServer50=QUOTE52=20220110-15:08:59.60456=demo.ctrader.344194557=APP_QUOTE_SESSION55=21499268=2269=0270=4611.3269=1270=4611.510=011
8=FIX.4.49=14935=W34=308549=cServer50=QUOTE52=20220110-15:08:59.61656=demo.ctrader.344194557=APP_QUOTE_SESSION55=44268=2269=0270=84.979269=1270=84.99910=160
8=FIX.4.49=15435=W34=308649=cServer50=QUOTE52=20220110-15:08:59.62156=demo.ctrader.344194557=APP_QUOTE_SESSION55=10093268=2269=0270=12.3705269=1270=12.373210=102
8=FIX.4.49=15135=W34=308749=cServer50=QUOTE52=20220110-15:08:59.62756=demo.ctrader.344194557=APP_QUOTE_SESSION55=47268=2269=0270=10.3224269=1270=10.325610=209
8=FIX.4.49=15135=W34=308849=cServer50=QUOTE52=20220110-15:08:59.62756=demo.ctrader.344194557=APP_QUOTE_SESSION55=16268=2269=0270=1.89153269=1270=1.8916210=231
8=FIX.4.49=15135=W34=308949=cServer50=QUOTE52=20220110-15:08:59.64556=demo.ctrader.344194557=APP_QUOTE_SESSION55=17268=2269=0270=1.43272269=1270=1.4327910=224
8=FIX.4.49=14935=W34=309049=cServer50=QUOTE52=20220110-15:08:59.64556=demo.ctrader.344194557=APP_QUOTE_SESSION55=27268=2269=0270=0.7306269=1270=0.730710=116
8=FIX.4.49=15135=W34=309149=cServer50=QUOTE52=20220110-15:08:59.64756=demo.ctrader.344194557=APP_QUOTE_SESSION55=19268=2269=0270=1.71687269=1270=1.7169810=238
8=FIX.4.49=14935=W34=309249=cServer50=QUOTE52=20220110-15:08:59.65356=demo.ctrader.344194557=APP_QUOTE_SESSION55=29268=2269=0270=9.1323269=1270=9.134310=124
8=FIX.4.49=15435=W34=309349=cServer50=QUOTE52=20220110-15:08:59.66456=demo.ctrader.344194557=APP_QUOTE_SESSION55=22333268=2269=0270=1.53393269=1270=1.5340710=115
8=FIX.4.49=15435=W34=309449=cServer50=QUOTE52=20220110-15:08:59.67456=demo.ctrader.344194557=APP_QUOTE_SESSION55=22338268=2269=0270=1.02659269=1270=1.0269710=126
8=FIX.4.49=14935=W34=309549=cServer50=QUOTE52=20220110-15:08:59.67456=demo.ctrader.344194557=APP_QUOTE_SESSION55=64268=2269=0270=0.9151269=1270=0.915410=126
8=FIX.4.49=15235=W34=309649=cServer50=QUOTE52=20220110-15:08:59.71656=demo.ctrader.344194557=APP_QUOTE_SESSION55=21576268=2269=0270=7455.8269=1270=7456.210=035
8=FIX.4.49=14935=W34=309749=cServer50=QUOTE52=20220110-15:08:59.74256=demo.ctrader.344194557=APP_QUOTE_SESSION55=45268=2269=0270=75.179269=1270=75.19510=144
8=FIX.4.49=15135=W34=309849=cServer50=QUOTE52=20220110-15:08:59.74856=demo.ctrader.344194557=APP_QUOTE_SESSION55=57268=2269=0270=10.0536269=1270=10.055910=222
8=FIX.4.49=14935=W34=309949=cServer50=QUOTE52=20220110-15:08:59.77056=demo.ctrader.344194557=APP_QUOTE_SESSION55=44268=2269=0270=84.979269=1270=84.99810=165
8=FIX.4.49=15135=W34=310049=cServer50=QUOTE52=20220110-15:08:59.77256=demo.ctrader.344194557=APP_QUOTE_SESSION55=60268=2269=0270=317.895269=1270=318.06510=218
8=FIX.4.49=14935=W34=310149=cServer50=QUOTE52=20220110-15:08:59.78856=demo.ctrader.344194557=APP_QUOTE_SESSION55=22268=2269=0270=8.8943269=1270=8.895410=145
8=FIX.4.49=15135=W34=310249=cServer50=QUOTE52=20220110-15:08:59.78856=demo.ctrader.344194557=APP_QUOTE_SESSION55=59268=2269=0270=12.0482269=1270=12.050210=206
8=FIX.4.49=14735=W34=310349=cServer50=QUOTE52=20220110-15:08:59.79556=demo.ctrader.344194557=APP_QUOTE_SESSION55=69268=2269=0270=6.58269=1270=6.581410=035
8=FIX.4.49=15435=W34=310449=cServer50=QUOTE52=20220110-15:08:59.79556=demo.ctrader.344194557=APP_QUOTE_SESSION55=22334268=2269=0270=8.91296269=1270=8.9153510=136
8=FIX.4.49=15035=W34=310549=cServer50=QUOTE52=20220110-15:08:59.80756=demo.ctrader.344194557=APP_QUOTE_SESSION55=21499268=2269=0270=4610.8269=1270=461110=169
8=FIX.4.49=14835=W34=310649=cServer50=QUOTE52=20220110-15:08:59.80756=demo.ctrader.344194557=APP_QUOTE_SESSION55=54268=2269=0270=7.438269=1270=7.439710=084
8=FIX.4.49=15135=W34=310749=cServer50=QUOTE52=20220110-15:08:59.80756=demo.ctrader.344194557=APP_QUOTE_SESSION55=47268=2269=0270=10.3222269=1270=10.325510=199
8=FIX.4.49=15035=W34=310849=cServer50=QUOTE52=20220110-15:08:59.83656=demo.ctrader.344194557=APP_QUOTE_SESSION55=5268=2269=0270=0.71608269=1270=0.7161110=159
8=FIX.4.49=15435=W34=310949=cServer50=QUOTE52=20220110-15:08:59.85656=demo.ctrader.344194557=APP_QUOTE_SESSION55=22338268=2269=0270=1.02659269=1270=1.0269410=122
8=FIX.4.49=14935=W34=311049=cServer50=QUOTE52=20220110-15:08:59.86656=demo.ctrader.344194557=APP_QUOTE_SESSION55=15268=2269=0270=90.976269=1270=90.98510=140
Session FIX.4.4:demo.ctrader.3441945->cServer:QUOTES disconnecting: System.Net.Sockets.SocketException (10054): An existing connection was forcibly closed by the remote host.
// at QuickFix.SocketInitiatorThread.ReadSome(Byte[] buffer; Int32 timeoutMilliseconds) in C:\Users\radul\Google Drive\C#\quickfixn\QuickFIXn\SocketInitiatorThread.cs:line 154 // at QuickFix.SocketInitiatorThread.Read() in C:\Users\radul\Google Drive\C#\quickfixn\QuickFIXn\SocketInitiatorThread.cs:line 81
2022-01-10 15:09:00.6125710WarningClient_QuoteConnectionChangeQuote disconnected on remote side. remoteDiscionnectContainer.Count=12022-01-10 15:09:00.6129186InfoDisconnectDisconnect called for cTraderFIXConnector account:3441945 vendor:CTRADERDEMO_FIX
@slukk200
slukk200
17 Dec 2021, 00:25
RE:
amusleh said:
Hi,
That tag value is empty, so it doesn't make any sense to put something else on it.
To solve the QuickFix issue you can disable the tag value check on your configuration by setting ValidateFieldsHaveValues to N: Configuring QuickFIX (quickfixengine.org)
That is exactly what I did, but I think it is a nasty workaround. It is always good to have validation checks. I was hoping maybe someone from support takes a look at this.
@slukk200
slukk200
01 Mar 2022, 20:04
RE: RE: RE: RE: FIX API crash(usually after 1-20 minutes) : An existing connection was forcibly closed by the remote host
If someone is facing with the same issue, it looks like It was the VPS. There was nothing wrong with my code. There are some brokers who don't really like some (particularly fast)VPS and they keep closing the connection every few minutes. Once I switched to a slower VPS everything worked perfectly. We are probably talking about milliseconds here so not a big deal for me, but if you are doing some HFT stuff it could be a problem for you.
@slukk200