Is it necessary to logout prior to closing the connection to the FIX API?

Created at 03 May 2023, 03:26
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
JO

johnson.fergusaka

Joined 24.03.2023

Is it necessary to logout prior to closing the connection to the FIX API?
03 May 2023, 03:26


I'm writing a "cleanup function" that should be ran before my program closes.
Right now it just closes the connection between the FIX API and the client (I'm using golang). 

If it is necessary to logout before closing the connection, what would i do in the event that the connection closes by itself? Should i use the Heartbeat?


@johnson.fergusaka
Replies

PanagiotisChar
03 May 2023, 09:10

Hi there,

If it is necessary to logout before closing the connection

It is not, the server will close the connection if it does not receive a heartbeat

 what would i do in the event that the connection closes by itself? 

Just connect again.

Aieden Technologies

Need help? Join us on Telegram

Need premium support? Trade with us


 


@PanagiotisChar

johnson.fergusaka
03 May 2023, 19:12

RE:

PanagiotisChar said:

Hi there,

If it is necessary to logout before closing the connection

It is not, the server will close the connection if it does not receive a heartbeat

 what would i do in the event that the connection closes by itself? 

Just connect again.

Aieden Technologies

Need help? Join us on Telegram

Need premium support? Trade with us


 

So if I set heartbeat to 0, I would have to close the connection myself?


@johnson.fergusaka

PanagiotisChar
04 May 2023, 10:56

Hi,

No you don't. The server will close the connection evetnually.

Aieden Technologies

Need help? Join us on Telegram

Need premium support? Trade with us

 


@PanagiotisChar