Reliability of connection state-change notifications (onMessage)
SFXbernhard
Post subject: Reliability of connection state-change notifications (onMessage)
Post rating: 0
Posted: Sat 21 Apr, 2012, 20:09
User rating: 21
Joined: Thu 19 May, 2011, 20:50 Posts: 413 Location: Germany, Munich
API Support wrote:
Hi,
If you need to monitor the platform connection in your strategy, you can use the CONNECTION_STATUS message. Please take a look at the following JForex Wiki page: http://www.dukascopy.com/wiki/index.php ... connecting.
It would be nicer to get the status itself: something like CONNECTED or DISCONNECTED
SFXbernhard
Post subject: Re: Reliability of connection state-change notifications (onMessage)
Post rating: 0
Posted: Fri 01 Apr, 2022, 00:18
User rating: 21
Joined: Thu 19 May, 2011, 20:50 Posts: 413 Location: Germany, Munich
It is possible to check by getContent()
if (message.getType() == IMessage.Type.CONNECTION_STATUS){ if (message.getContent().equals("Disconnected")) { } if (message.getContent().equals("Connected")) { } }