Page 6 of 6 FirstFirst ... 456
Results 51 to 54 of 54
  1. #51
    Administrator
    Join Date
    Feb 2008
    Location
    Siracusa
    Posts
    134
    Hi strangecarr,

    here a recap of the basic steps required to start a streaming session with IG platform:

    1. Generate a new API key for the selected account (demo or live), as per instructions you can find here
    2. Login to the chosen environment by using the session API (see the POST method, version 3). Please consider that you can accomplish this task even by using the API Companion, which offers you a web-based form.
    3. Login to the IG platform by using the Python API, providing the required information as per instructions you can find here; basically you have to provide data returned by the session API response, which includes the the Lightstreamer endpoint to contact, and the updated security tokens, as follows:

      where <password> has to be in the form CST-<cst_token>|XST-<x_security_token>, with <cst_token> and <x_security_token> as provided by the session API response.


    Hope this helps, but please have a look at the IG documentation for getting more information.
    Thanks and Regards
    Gianluca

  2. #52
    Quote Originally Posted by epep View Post
    You're right !

    It seems that IG changed something about the persistence of authentication tokens, my script get stuck trying to reconnect with invalid password … I need more intelligence here. I'll let you know as soon as I have done something good.
    Hello epep, I'm trying to get the IG Streaming API up and running but I'm having the same problem as you. Did you finally manage to solve the problem? Thanks!

  3. #53
    Hi Gianluca,

    First of all, thank you very much for the code, it has been really useful for me. I'm also using it to connect to the IG Streaming API and it has work just fine, the only problem that I'm having is the reconnect issue as stated by IG:

    The Lightstreamer client should also have the ability to reconnect in the event of a connection failure or if instructed by the Lightstreamer server (e.g. due to a LOOP rebind message). A re-connection attempt can fail if the CST and X-SECURITY-TOKEN tokens have expired in which case it will be necessary to re-authenticate to obtain new security tokens.
    I was thinking on adding a Timer to the LSClient class, connecting the timeout (after 2 seconds for example) to a new method that unsubscribes, disconnects and reconnects and resubscribe. Obviously I will have to end the session with the rest api and start a new one to get new session tokens.
    What do you think of this approach?

    Thanks in advance!

  4. #54
    Administrator
    Join Date
    Feb 2008
    Location
    Siracusa
    Posts
    134
    Hi Mamoa,
    it can certainly work, but the LSClient should be left as a general purpose Lightstreamer Client, hence I believe that your proposed logic should be put somewhere else, because it catches a specific use case.

    Reconnection is a feature handled by other official Lightstreamer Client, by it is supposed that credentials do not change or, if they do, you have to write some custom logic to provide updated values.

    Please let me know if your reconnection proposal also involves handling of new session tokens.

    Thanks, Gianluca

 

 

Similar Threads

  1. Python Client Library for Lightstreamer
    By Alessandro in forum Client Protocol
    Replies: 1
    Last Post: December 18th, 2014, 05:15 PM
  2. how to comunicate lightstreamer server by python
    By keyan in forum Client APIs
    Replies: 4
    Last Post: December 18th, 2014, 05:12 PM
  3. Replies: 2
    Last Post: January 5th, 2012, 08:53 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT +1. The time now is 12:31 PM.