Exemple #1
0
        void OnClose(object sender, CloseEventArgs args)
        {
            while (QueuedActions.TryDequeue(out Action action))
            {
            }

            Status = Status.Disconnected;
            Socket = null;
            TopicSubscriptions.Clear();
            TopicPublishers.Clear();
        }
Exemple #2
0
 public void Disconnect()
 {
     if (Socket != null)
     {
         if (Socket.ReadyState == WebSocketState.Open)
         {
             Status = Status.Disconnecting;
             Socket.CloseAsync();
         }
     }
     TopicSubscriptions.Clear();
     TopicPublishers.Clear();
 }
Exemple #3
0
 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;
 }
Exemple #4
0
            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;
            }