コード例 #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;
                }
            }
        }
コード例 #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.
 }
コード例 #3
0
        /// <summary>
        /// Connects the default socket.
        /// </summary>
        private void ConnectDefaultSocket()
        {
            _socket = GetNextSocket();

            OnNewDefaultConnection();
        }
コード例 #4
0
 /// <summary>
 /// Connects the socket.
 /// </summary>
 private void Connect()
 {
     _socket = GetNextSocket();
 }