Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • Refinitiv Data Platform /
  • Refinitiv Data Platform Libraries /
avatar image
REFINITIV
Question by Alena.Melnikova · Oct 26, 2020 at 02:50 AM · pythonrdp-apirefinitiv-data-platformwebsocketsrefinitiv-data-platform-libraries

WebSocket error occurred for web socket client. Connection is already closed.

Hi,
We use refinitiv-dataplatform==1.0.0a6 and Python 3.8.6 (Debian GNU/Linux 10 (buster))

It works fine but after a few hours it returns:

[2020-10-26 02:15:04,471] - [session.platform] - [ERROR] - [stream_connection] - [_ws_error] - WebSocket error occurred for web socket client 1 (login id 2483) : Connection is already closed.
[2020-10-26 02:16:05,363] - [session.platform] - [ERROR] - [stream_connection] - [_ws_error] - WebSocket error occurred for web socket client 1 (login id 2484) : Connection is already closed.

What could be the issue?


Python code:

def streaming_prices():
    streaming_prices = rdp.StreamingPrices(
        universe=list_of_rics,
        on_update=lambda streaming_price, instrument_name, fields:
        display_updated_fields(streaming_price, instrument_name, fields)
    )
    streaming_prices.open()
    while True:
        try:
            asyncio.get_event_loop().run_until_complete(asyncio.sleep(1))
        except (KeyboardInterrupt, SystemExit):
            rdp.close_session()
            break

People who like this

0 Show 0
Comment
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Reply

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by Gurpreet · Oct 31, 2020 at 01:24 PM

Hi @Alena.Melnikova,

There is an updated version of RDP library refinitiv-dataplatform 1.0.0a7. Can you please try with this.

I am trying to ascertain if it is the Refresh token renewal which fails or your network components - proxy/firewall drops the connection. For latter, are you able to perform this test from a different network like home or office. Keeping track of how long it stays connected will also help.

Comment

People who like this

0 Show 1 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

avatar image
REFINITIV
Alena.Melnikova · Nov 02, 2020 at 02:21 AM 0
Share

Hi @Gurpreet,

Thanks for the response. Interesting but I didn't see this error for a few days already. Don't know what was a problem.

I'll try with 1.0.0a7 during this week, thanks for the update!
Unfortunately, I can't test on different networks. For long runs, I can only run on ec2. I'll let you know if see a similar issue again.

Watch this question

Add to watch list
Add to your watch list to receive emailed updates for this question. Too many emails? Change your settings >
10 People are following this question.

Related Questions

Cannot retrieve ESG data via RDP libraries in Python

Will the Refinitiv Data Platform (RDP) Library for python support data contribution in the future?

RDP python library not raising exception on invalid_token

Connection to streaming news works in jupyter notebook but not in python script

Python RDP get_historical_price_summaries

  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Connected Risk APIs
  • DSS
  • Data Fusion
  • Data Model Discovery
  • Datastream
  • Eikon COM
  • Eikon Data APIs
  • Electronic Trading
    • Generic FIX
    • Local Bank Node API
    • Trading API
  • Elektron
    • EMA
    • ETA
    • WebSocket API
  • Intelligent Tagging
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open Calais
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • RDMS
  • Refinitiv Data Platform
    • Refinitiv Data Platform Libraries
  • Rose's Space
  • Screening
    • Qual-ID API
    • Screening Deployed
    • Screening Online
    • World-Check One
    • World-Check One Zero Footprint
  • Side by Side Integration API
  • TR Knowledge Graph
  • TREP APIs
    • CAT
    • DACS Station
    • Open DACS
    • RFA
    • UPA
  • TREP Infrastructure
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • Workspace SDK
    • Element Framework
    • Grid
  • World-Check Data File
  • 中文论坛
  • Explore
  • Tags
  • Questions
  • Badges