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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
10 5 3 5

How to clean streaming connection through websocket api

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.

1 Answer

· Write an Answer
Upvotes
Accepted
16.6k 79 39 63

Hi @lzhuang1

If you mean by "clean streaming connection" is to close streaming subscriptions, you will need to issue a Close request. You can find more details within the documentation. Alternatively, you can disconnect your connection to the server. The server will no longer keep active streams open. However, if you are looking to "clean" you connection by disconnecting, then later wish to reopen new streams, you will of course need to reconnect.

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 Nick, thanks for your prompt response! By saying "Close request" do you mean login close request? I don't want to logout though, what I want is keep the login state but just recall all streaming requests to save traffics, and I might resend a streaming request in the future if needed, is that possible? Many thanks!

Hi @lzhuang1,

What I mean by "Close request" is not the login request but rather a request to close an individual opened item stream. For example, once you have successfully logged in to the server, you begin to open streaming requests. At anytime, you can close one of these item requests - refer to the documentation link I provided above. You can reopen them at anytime. If you haven't already, I would encourage you to work through the Quick Start to gain a better understanding of the operation. I would then work through the tutorial section that provides a deeper understanding of the concepts. Within the tutorial section you will find some details related to Closing Event Streams.

Hi @nick.zincone.1, thanks, I will take a look at the documentation. Another question, is there any problems with a long running stream request? I have to clean the requests because I found that if I have many streaming requests all of which are long-running (more than 24 hours), the responses will be stop at some point. Is there parameter in the request controls the lifetime of the streaming requests? Thank you!

Show more comments
Show more comments

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.