/// <summary> /// Disconnect from the end unit. /// </summary> public void Disconnect() { _tcpClient?.Close(); _frameBuffer?.Dispose(); // workaround for https://github.com/Apollo3zehn/FluentModbus/issues/44#issuecomment-747321152 if (RuntimeInformation.FrameworkDescription.StartsWith(".NET Framework", StringComparison.OrdinalIgnoreCase)) { _tcpClient = null; } }
/// <summary> /// Closes the opened COM port and frees all resources. /// </summary> public void Close() { _serialPort?.Close(); _frameBuffer?.Dispose(); _messageBuffer?.Dispose(); }
/// <summary> /// Disconnect from the end unit. /// </summary> public void Disconnect() { _tcpClient?.Close(); _frameBuffer?.Dispose(); }