Esempio n. 1
0
        public void Dispose()
        {
            lock (_syncRoot)
            {
                _disposed = true;

                if (_socket != null)
                {
                    _socket.Dispose();
                    _socket = null;
                }

                if (_nodeSocketMap != null)
                {
                    foreach (var socket in _nodeSocketMap.Values)
                    {
                        socket.Dispose();
                    }

                    _nodeSocketMap = null;
                }
            }
        }
Esempio n. 2
0
 /// <summary>
 /// Initializes a new instance of <see cref="ClientResponseContext"/> class.
 /// </summary>
 /// <param name="stream">Stream.</param>
 /// <param name="socket">Socket.</param>
 public ClientResponseContext(IBinaryStream stream, ClientSocket socket)
     : base(stream, socket)
 {
     // No-op.
 }
Esempio n. 3
0
        /// <summary>
        /// Connects the default socket.
        /// </summary>
        private void ConnectDefaultSocket()
        {
            _socket = GetNextSocket();

            OnNewDefaultConnection();
        }
 /// <summary>
 /// Connects the socket.
 /// </summary>
 private void Connect()
 {
     _socket = GetNextSocket();
 }