protected override void Dispose(bool disposing) { if (disposing) { lock (this) { if (_stream != null) { _stream.Dispose(); } if (_tcp != null) { _tcp.Close(); } ConnectionState = ClientState.Unconnected; _tcp = null; _stream = null; _localPlayerNumber = -1; _playerData = default(TPlayerData); } } base.Dispose(disposing); }
/// <summary> /// Disposes the underlying stream. /// </summary> public void Dispose() { _stream.Dispose(); //GC.SuppressFinalize(this); }