private void OnClientDisconnected(SocketerClient client, int sourceId, string hostAddress)
 {
     if (clientConnection != null)
     {
         Debug.Log("Client disconnected");
         clientConnection.StopIncomingMessageQueue();
         oldConnections.Enqueue(clientConnection);
         clientConnection = null;
     }
 }
示例#2
0
 private void OnClientDisconnected(SocketerClient client, MessageEvent e)
 {
     if (clientConnection != null)
     {
         Debug.Log("Client disconnected");
         clientConnection.StopIncomingMessageQueue();
         oldConnections.Enqueue(clientConnection);
         clientConnection = null;
     }
 }
        private void OnClientDisconnected(SocketerClient client, int sourceId, string hostAddress)
        {
            if (clientConnection != null)
            {
                Debug.Log("Client disconnected");
                clientConnection.StopIncomingMessageQueue();
                oldConnections.Enqueue(clientConnection);
                clientConnection = null;
            }

            if (!AttemptReconnectWhenClient)
            {
                Debug.Log("Stopping subscriptions to disconnected client");
                client.Stop();
                client.Connected    -= OnClientConnected;
                client.Disconnected -= OnClientDisconnected;

                if (this.client == client)
                {
                    Debug.Log("Clearing client cache");
                    this.client = null;
                }
            }
        }