void OnClose(object sender, CloseEventArgs args) { while (QueuedActions.TryDequeue(out Action action)) { } Status = Status.Disconnected; Socket = null; TopicSubscriptions.Clear(); TopicPublishers.Clear(); }
public void Disconnect() { if (Socket != null) { if (Socket.ReadyState == WebSocketState.Open) { Status = Status.Disconnecting; Socket.CloseAsync(); } } TopicSubscriptions.Clear(); TopicPublishers.Clear(); }
void OnClose(object sender, CloseEventArgs args) { //if (!args.WasClean) //{ // UnityEngine.Debug.LogError(args.Reason); //} Subscriptions.Clear(); Services.Clear(); QueuedActions.Clear(); QueuedSends.Clear(); TopicSubscriptions.Clear(); TopicPublishers.Clear(); Status = BridgeStatus.Disconnected; }
public override void Disconnect() { if (Socket == null) { return; } QueuedActions.Clear(); Buffer.Clear(); lock (Readers) { Readers.Clear(); } Status = BridgeStatus.Disconnected; TopicSubscriptions.Clear(); TopicPublishers.Clear(); Socket.Close(); Socket = null; }