question

Upvotes
Accepted
30 3 2 2

RDP WebSocket hanging when connecting

I have a problem running a python sample (market_price_spot.py) for testing the WebSocket RDP connection. In two computers that I tested, it worked as expected. But on other two, after retrieving the token successfully, the program hangs when trying to connect to the websocket address - an error does not happen, it just stands there waiting for a connection that will not happen.

Connecting to WebSocket wss://amer-3-t1.streaming-pricing-api.refinitiv.com/WebSocket for session1...

In the same computer, the same credentials were used in a similar C# sample and it worked as expected. So it is not a connectivity problem nor the credentials.

The python and libraries versions are:

Python: 3.9.2

WebSocket-client library: 0.58.0

requests library: 2.25.1

In the a Q&A in the developer pages of the "WebSocket API quickstart" that says that the versions should be "2.7.14, 3.6.7" and websocket-client greater than 0.49, but I think it should work with the versions I have.

Has someone come accross a problem like this one? Or that can suggest something to make it work?

rdp-apirefinitiv-data-platformwebsockets
icon clock
10 |1500

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

Upvote
Accepted
23k 22 9 14

Hello @henrique.hissataka,

There is an issue with some python clients, with websocket-client <=0.57 vs 0.58. Works with one or the other, the module does not report any errors when it does not.

I would try example Discovery, latest from GitHub, as suggested by @Gurpreet and it should run.

You can try:

python -m pip install websocket-client==0.57.0

to see if spot example requires <= 0.57

icon clock
10 |1500

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

Upvote
13k 32 12 18

Hello @henrique.hissataka,

Can you try to use the service discovery example from github and see if you still have issues. One clear difference in C# and Python is that .NET will use the system proxy information if set, whereas Python will not. So, if you are behind proxy/firewall, you will have to explicitly configure the python modules to use it.

Let us know your findings, and we can help you resolve any issues.

icon clock
10 |1500

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

Upvotes
30 3 2 2

Thanks a lot, @zoya.farberov, by switching the websocket-client to 0.57.0 made the sample I was using work as expected. A client for whom I was making this checking reported that for him the library version 0.48, 0.55 and 0.57 worked, but the 0.50 and 0.58 didn't...

I will try later the last version of Discovery as suggested by @Gurpreet, thanks for the suggestion!

icon clock
10 |1500

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

Click below to post an Idea Post Idea