Beispiel #1
0
        public void Connect()
        {
            if (_socket == null)
            {
                _socket = CreateSocket(WebSocketUri);
                AttachEvents();
            }

            Task.Run(ConnectAndStartListening).ConfigureAwait(false);
        }
        /// <inheritdoc cref="ITransport" />
        public void Connect()
        {
            if (_socket == null)
            {
                _socket = CreateSocket(WebSocketUri);
                AttachEvents();
            }

            StartReaderBackgroundThread();
        }
Beispiel #3
0
 private void DisposeSocketConnection()
 {
     DetachEvents();
     try
     {
         _socket?.Dispose();
     }
     catch (Exception e)
     {
         Logger.Warning("Error while disposing socket. Nothing to worry about. Message: " + e.Message);
     }
     finally
     {
         _socket = null;
     }
 }