Example #1
0
        internal override void StopInternal()
        {
            if (socket != null && socket.State == GameSparksWebSocketState.Open)
            {
                socket.Terminate();
                socket = null;
            }

            session = null;
        }
Example #2
0
 internal void Close()
 {
     if (_WebSocketClient != null)
     {
         lock (_WebSocketClient)
         {
             if (_WebSocketClient != null)
             {
                 //GameSparksWebSocketState state = _WebSocketClient.State;
                 //if (state == GameSparksWebSocketState.Open || state == GameSparksWebSocketState.Connecting)
                 {
                     _WebSocketClient.Terminate();
                 }
             }
         }
     }
 }