public void Destroy() { try { if (TcpClient != null && TcpClient.Client != null) { TcpClient.Client.Close(); TcpClient = null; } if (RestartableStream != null) { RestartableStream.Close(); RestartableStream = null; } if (Stream != null) { Stream.Close(); Stream = null; } Buffer = null; } catch { } }
public void Destroy() { try { TcpClient?.Client?.Close(); TcpClient = null; RestartableStream?.Close(); RestartableStream = null; Stream?.Close(); Stream = null; Buffer = null; } catch { // ignored } }