The existing connection was closed by remote server/ forcibly closed
The existing connection was closed by remote server/ forcibly closed
27 Feb 2021, 06:41
Dear Community,
I am implementing a supervising and automatic trading program using Spotware Open API. It is a great API for this purpose.
Though, I've got connection problem since 4 days always again.
After running 3-10 hours, this program got exception like "A message can not write. the existing connection was closed by remote server" or "forcibly closed by remote server".
Can you please help me to solve this issue?
The program accesses 3-20 demo accounts. It sends reconcile request about each account in every 1 or 2 seconds.
And it sends trader request at the same time interval for each account.
It doesn't send regular heartbeat because reconcile request and trader requests are regularly sent.
5-10 symbol spot events are set. Sporadically it sends position amendment request and some other requests but these requests are sent probably 10 times for an hour.
Why is the connection closed by server?
Is there any limitation for reconcile, trader request frequency?
Replies
budda_dan2020
02 Mar 2021, 19:17
RE:
PanagiotisCharalampous said:
Hi budda_dan2020,
One of the reasons that the server will close the connection is to avoid a buffer overflow, meaning that your application does not read data from the stream fast enough, therefore the stream fills up and the server has nowhere to write the new data. Check if this could be the reason.
Best Regards,
Panagiotis
This was exactly my problem.
Thanks for the answer. I should have asked you before about it.
@budda_dan2020
PanagiotisCharalampous
01 Mar 2021, 10:08
Hi budda_dan2020,
One of the reasons that the server will close the connection is to avoid a buffer overflow, meaning that your application does not read data from the stream fast enough, therefore the stream fills up and the server has nowhere to write the new data. Check if this could be the reason.
Best Regards,
Panagiotis
Join us on Telegram
@PanagiotisCharalampous