Session Statuses

Brief

The article describes session statuses.

Details

The description of session statuses is provided below.

Session Status

Session Status Description

Disconnected

The session is disconnected from the server.

From this status, the session is transferred to the Connecting status in case the user tries to log in.

Connecting

The user specified login information and the session is being connected to the server.

From this status, the session can be transferred to one of the following statuses:

Connected
In case the login was successful, the session is transferred to the Connected status.

TradingSessionRequested
This status is possible only on connections having more than one trading session or requiring a PIN code.
The session is transferred to the status TradingSessionRequested when it was requested to specify a PIN or database.

Disconnected
In case the login failed, the session is transferred to the Disconnected status.

Connected

The login was successful, the session is connected successfully.

For connections with multiple trading sessions or requiring a PIN code, a valid PIN or database was specified, the session is connected successfully.

This is the only status when most of the methods of the session object can be used.

From this status, the session can be transferred to one of the following statuses:

Disconnecting
In case the user logged out, the session is transferred to the Disconnecting status.

Reconnecting
In case the connection was lost, the session is transferred to the Reconnecting status.

PriceSessionReconnecting
This status is possible only on connections with the price session.
The session is transferred to this status in case the connection with the price session was lost.

SessionLost
In case the session expired or the server was shut down, the session is transferred to the status SessionLost.

Disconnecting

The user logged out, the current session is being disconnected.

From this status, the session is transferred to the Disconnected status.

Reconnecting

For connections without the price session: The connection was lost. The core is attempting to restore the connection.

For connections with the price session: The connection with the price session was lost and either:

1. The connection with the trade session exists but the maximum number of attempts to reconnect to the price session was reached (currently 20)
or
2. The connection with the trade session was lost.

The core is attempting to restore the connection with the trade session.

From this status, the session can be transferred to one of the following statuses:

Reconnecting
For connections without the price session: The core attempts to restore the connection and stays in this status after each unsuccessful attempt until the maximum number of attempts to reconnect is reached (currently 20).

For connections with the price session:
1. If the maximum number of attempts to reconnect to the price session was reached, the core attempts to restore the connection with the trade session only once.
2. If the connection with the trade session was lost, the session makes the maximum number of attempts to restore the connection with the trade session and then with the price session.

Connected
If the connection was restored, the session is transferred to the Connected status.

SessionLost
The reconnect failed or the maximum number of attempts to reconnect was reached (currently 20), ForexConnect closes the session, and the SessionLost status is received.

TradingSessionRequested

This status is possible only on connections having more than one trading session or requiring a PIN code.

After the user entered the login information, the server requests the trading session or a PIN code. The login process is suspended until a subsession or a PIN is specified.

From this status, the session can be transferred to one of the following statuses:

Connected
In case a valid PIN or database was specified, the session is transferred to the Connected status.

TradingSessionRequested
In case an invalid PIN was specified, ForexConnect provides the second and then the third attempt to enter a valid PIN, the session stays in the TradingSessionRequested status.

Disconnected
The session is transferred to the Disconnected status if:
• An invalid database is specified;
• An invalid PIN is entered at the third attempt. In this case, login to the connection is locked.

PriceSessionReconnecting

This status is possible only on connections with the price session.
The connection with the price session was lost. The core is attempting to restore the connection with the price session.

From this status, the session can be transferred to one of the following statuses:

Connected
In case the connection with the price session was restored, the session is transferred to the status Connected.

PriceSessionReconnecting
The price session attempts to reconnect once and stays in this status after each unsuccessful attempt until the maximum number of attempts to reconnect is reached (currently 20).

Reconnecting
The connection with the trade session was lost or the maximum number of attempts to reconnect to the price session was reached (currently 20). ForexConnect tries to reconnect to the trade session, in this case the Reconnecting status is received.

SessionLost

The session was lost.

The session is transferred to this status in one of the following cases:

• The session expired;
• The server was shut down;
• Reconnect failed;
• The maximum number of attempts to reconnect to the trade session was reached (currently 20).

From this status, the session is transferred to the Disconnected status.

back