- ago
How and when should I disconnect the backend connection in my custom streaming data provider?

When I enable Streaming on the chart window, my provider's Connect method is called. I create a Websocket connection to the backend and subscribe to the required symbols.

When I disconnect streaming quotes on the chart window, I want my streaming provider to disconnect the web socket connection. I do not see any override to implement the disconnection event in my custom streaming provider.

How to handle the disconnect event?
0
262
3 Replies

Reply

Bookmark

Sort
- ago
#1
https://www.wealth-lab.com/Support/ExtensionApi/StreamingDataProvider

CODE:
public void Disconnect(string reason, Exception ex = null)


If you detect a disconnection in your connection to the streaming data source, you can call this method to inform WL8 that the connection has been shut down. Pass the reason, and an instance of an Exception in the ex parameter if available.
0
- ago
#2
You mentioned the way to communicate my backend disconnection to WL.

But what I need is a way to disconnect my backend connection when WL no longer needs it. For example, when I disconnect streaming mode in my WL UI, I do not need to maintain the backend connection in my adapter code.
0
Glitch8
 ( 10.62% )
- ago
#3
It’s currently not possible, once connected the streaming connection remains until WL8 closes.
0

Reply

Bookmark

Sort