RingCentral .Net SDK
|
WebSocket Extension adds support for WebSocket protocol.
Each WebSocketExtension can only create one subscription. If you need to create multiple subscriptions, you need to create multiple WebSocketExtension instances. Creating multiple subscriptions with one WebSocketExtension instance will cause the last subscription to override the previous ones.
In order to keep your WebSocket appliation 24 * 7 running, there are several things that you need to handle:
rc.Refresh()
to refresh the token.wsExtension.Reconnect()
when network is back.rc.Refresh()
will fail and your WebSocket connection will not function either. In this case, you need to generate a new token and wsExtension.Reconnect()
.Please refer to this demo code: https://github.com/tylerlong/RingCentral.WebSocket.Demo/blob/main/RingCentral.WebSocket.Demo/Program.cs
Please read the comments in the code carefully.