コード例 #1
0
        public void Connect()
        {
            if (_socket == null)
            {
                _socket = CreateSocket(WebSocketUri);
                AttachEvents();
            }

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

            StartReaderBackgroundThread();
        }
コード例 #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;
     }
 }