Skip to content

Commit

Permalink
Relay needs to wait for response (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
dasgarner committed Oct 17, 2023
1 parent 06b8d87 commit 0dd335d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Worker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -267,12 +267,19 @@ Task Relay(CancellationToken stoppingToken)
bool result = _relayQueue.TryTake(out string message, -1, stoppingToken);
if (result && !string.IsNullOrEmpty(message))
{
_logger.LogDebug("Relay message");
bool sendResult = relaySocket.TrySendFrame(message);
if (!sendResult)
{
_logger.LogError("Unable to relay message");
}

bool receiveResult = relaySocket.TryReceiveFrameString(TimeSpan.FromMilliseconds(500), out string sendReturn);
if (!receiveResult)
{
_logger.LogError("Unable to relay message, no response");
}

_logger.LogDebug("Relay message: {return}", sendReturn);
}
}

Expand Down

0 comments on commit 0dd335d

Please sign in to comment.