Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Try to find an answer in Wiki before asking a question.
    Submit programming questions in this forum only.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

How to re-establish lost connection/authentication
 Post subject: How to re-establish lost connection/authentication Post rating: 0   New post Posted: Wed 16 Nov, 2011, 19:33 

User rating: 3
Joined: Mon 23 May, 2011, 16:06
Posts: 17
Location: Hungary,
Dear Support Team,

I'm trying to put together a suitable code for re-establishing lost connection/authentication. Could you answer the questions as follows.

1. Is it possible to make automatic full re-connection trials (using IClient.connect()) with a live account at all? I mean, is captcha always needed for authentication or, re-connection trials (later calls of IClient.connect()) can be made without it?

2. There are several (three, I think) ways for a trader program to keep track of connection status. IClient.ISystemListener’s onConnect()/onDisconnect(), IClient.isConnected() and, within onMessage() of the strategy class itself, IConnectionStatusMessage.isConnected(). Are there any differences between these status indications or they always hold strictly the same status?

3. Is there any time-out set in the API for reconnection trials to take place? I mean, how long should an outage last so that you can definitely state that there is no hope to re-gain the connection by repeated calls of IClient.reconnect() and/or .connect()?

Thanks, regards,
Argiris


 
 Post subject: Re: How to re-establish lost connection/authentication Post rating: 0   New post Posted: Fri 18 Nov, 2011, 14:11 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Argiris wrote:
Is it possible to make automatic full re-connection trials (using IClient.connect()) with a live account at all? I mean, is captcha always needed for authentication or, re-connection trials (later calls of IClient.connect()) can be made without it?
If you work with Standalone API, then there is no captcha.
Argiris wrote:
2. There are several (three, I think) ways for a trader program to keep track of connection status. IClient.ISystemListener’s onConnect()/onDisconnect(), IClient.isConnected() and, within onMessage() of the strategy class itself, IConnectionStatusMessage.isConnected(). Are there any differences between these status indications or they always hold strictly the same status?
IConnectionStatusMessage only arrives on system start and it won't inform you if the system is disconnected or trying to reconnect (such messages currently are not available from API). So basically onDisconnect() is the method to use to handle connectivity issues.
Argiris wrote:
3. Is there any time-out set in the API for reconnection trials to take place? I mean, how long should an outage last so that you can definitely state that there is no hope to re-gain the connection by repeated calls of IClient.reconnect() and/or .connect()?
Regarding Standalone API - there are no such restrictions - your code determines how frequently the client tries to reconnect and also the attempt count, see:
https://www.dukascopy.com/wiki/#JForex_S ... m_listener


 
 Post subject: Broken Link: How to re-establish lost connection/authentication Post rating: 0   New post Posted: Wed 16 Jan, 2013, 21:06 
User avatar

User rating: 98
Joined: Mon 23 Jul, 2012, 02:02
Posts: 656
Location: United States, Durham, NC
The preceding contains a Broken Link to the document cited.


 
 Post subject: Re: How to re-establish lost connection/authentication Post rating: 0   New post Posted: Thu 17 Jan, 2013, 08:24 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
The links have been updated.


 

Jump to:  

  © 1998-2025 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com