For a deeper look into our Elektron API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
5 2 3 8

Connecting to ADS Websocket failing

Today, the websocket was enabled on our ADS server and I am using ws://{IPaddress}:15000/websocket to try to connect to the websocket server but not able to connect to it. Receiving below error:

System.Net.Sockets.SocketException (0x80004005): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 159.43.120.70:15000

at System.Net.Sockets.TcpClient..ctor(String hostname, Int32 port)

at WebSocketSharp.WebSocket.setClientStream()

at WebSocketSharp.WebSocket.doHandshake()

at WebSocketSharp.WebSocket.connect()

I am using below sample code to try and test the connection but its failing. Can you please advise what could be the issue here?

websocket-api/MarketPriceExample.cs at master · Refinitiv/websocket-api · GitHub

websocketsrrtorefinitiv-realtime-optimisedADS
icon clock
10 |1500

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

Upvotes
Accepted
19.6k 50 14 20

It does not seem like your application can connect to ADS on the websocket port. It could be due to number of reasons:

1. ADS isn't really listening on websocket port - ask your market data admin to confirm and test if port 15000 is listening on the ADS machine (netstat -a)

2. Your application cannot reach ADS, i.e. it is unable to resolve the hostname

or

3. There is a firewall that is blocking the port.

Once you can confirm that you can connect to port 15000 on ADS from your machine, only then you can try out the sample.

icon clock
10 |1500

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

Upvotes
32.2k 40 11 19

Hello @jpatel2,

I have just verified by running the same example against my testbed.

On the command line I pass three parameters:

-h myHost -p 15000 -u myUser

I would suggest contacting your market data group or admin, and confirming these parameters, as well as the service name to use.

I would also suggest testing connectivity, via telnet from your testing machine to ADS on port 15000, either yourself, or your market data group will be able to help with this test, to be sure there is connectivity open to ADS host on 15000.

There is a small modification to code that you may need:

/* Request an item. */                                
sendMessage(                                    "{"                                    + "\"ID\": 2,"                                    
+ "\"Key\": {\"Name\":\"TRI.N\", \"Service\" : \"ELEKTRON_DD\"}"                                    + "}"                                    );

Where ELEKTRON_DD should be the service name on your local infra, that your local market data group/admin are good to confirm. However, this is not the main issue, the issue you see happens earlier in the workflow and is not related to service spec not included in the request.

Hope this helps - let us know how this works on your side.


icon clock
10 |1500

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

Upvotes
5 2 3 8

Hello @zoya faberov/ @Gurpreet ,

Thank you for your response. I did test the connectivity from my machine to the ADS server that is listening on port 15000 but its failing. However, its working fine for one of my colleague. So the issue is not with ADS not listening.

Maybe I do not have port 15000 open on my test machine. Does it require to be open on my test machine? i.e. an outbound connection on port 15000 on my test machine correct?

Thanks. Let me know.

icon clock
10 |1500

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

Upvotes
32.2k 40 11 19

Hello @jpatel2 ,

If you have the admin privileges on your machine, I would review and potentially adjust any local firewall settings.

However, if you do not, or if this does not help, as there may be other causes, you may not have the route from your local machine to the infra, I would suggest to contact your local network admin/group for help with network connectivity.

icon clock
10 |1500

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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