Reconnect a session that is no longer active

Share:

Description

Reconnect will create a new session and update the 'id' to the new authenticated id returned by the TrueFX server.

Usage

1
2
3
4
  Reconnect(x, ...)

  ## S3 method for class 'TFXsession'
 Reconnect(x, ...)

Arguments

x

an object to be re-connected

...

other args for methods

Details

After roughly 70 seconds, an authenticated TrueFX session will time-out. Also, a connection made with snapshot=FALSE will be disconnected after it is used once.

A non-active TrueFX session id is treated like an unauthenticated session.

Value

a TFXsession object of an active/authenticated session.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Cannot run because there may not be an internet connection
## Not run: 
## You must use your username and password instead of JSTrader and Ou812
sess <- ConnectTrueFX("USD/JPY", username='JSTrader', password='Ou812')
Disconnect(sess)
isActive(sess) #FALSE
Reconnect(sess)
isActive(sess) #TRUE

## End(Not run)