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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
11 3 3 3

WebSocket disconnected

When I use WebSocket example, and change to a fast RIC (for example EUR=), it quickly fills up the message limit and disconnected without clear error messages from the server.

Is this the expected behavior?

treprdp-apiwebsocketsrrto
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.

Hi @Richard Wang,

This isn’t expected behaviour.

Can you please provide some additional details. Is the example one of the examples packaged with the Elektron WebSocket package? If so, let me know specifically which one and I will try it to observe the behaviour on my end.

Can you please provide information requested by Nick?

Hi @Richard Wang,

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?

If yes please click the 'Accept' text next to the reply. This will guide all community members who have a similar question. Otherwise please post again offering further insight into your question.

Thanks,

AHS

Upvotes
Accepted
17.2k 82 39 63

Hi @Richard Wang,

Thanks for the update Richard. I went through the instructions for the Perl example, changed the RIC to one that was extremely active and have been running it for over an hour now. I intentionally ran it prior to market open so I could see the behavior at market open as this is the most active period. The example is still operating as expected - no disconnects - I'm still receiving data normally.

My environment is Windows and using strawberry Perl as per the README. Perhaps you are using a different version of Perl or as you suggested, could be network issues. The example does utilize the:

inactivity_timeout(0)

Which can be a cause for WebSocket 1006 due to inactivity. However, the example does use the required PING messages and the value of zero (0) is defined for unlimited inactivity.

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
11 3 3 3

Hi Nick,

Thanks! I am using the Perl example coming with the streaming package. The behavior is not consistent. Sometimes it can run for a long time, but sometimes it closes. The error message is

"WebSocket closed with status 1006."

If you cannot re-produce it at your end, it might be my network issue. You may close the case.

Thanks,

Richard

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.