void DisposeMessageHandling() { if (messagingClient != null) { messagingClient.Dispose(); messagingClient = null; } if (messageTransport != null) { messageTransport.Dispose(); messageTransport = null; } }
public void Dispose() { _cts?.Cancel(); _receiveTask?.Wait(); _transport?.Dispose(); }