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; } } }
/// <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. }
/// <summary> /// Connects the default socket. /// </summary> private void ConnectDefaultSocket() { _socket = GetNextSocket(); OnNewDefaultConnection(); }
/// <summary> /// Connects the socket. /// </summary> private void Connect() { _socket = GetNextSocket(); }