Skip to content

Commit

Permalink
logging: add log when failed to receive multipart message
Browse files Browse the repository at this point in the history
  • Loading branch information
limebell committed Dec 11, 2024
1 parent e8bab4f commit 323abe7
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/Libplanet.Net/Transports/NetMQTransport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,12 @@ private void ReceiveMessage(object? sender, NetMQSocketEventArgs e)
{
if (!e.Socket.TryReceiveMultipartMessage(TimeSpan.Zero, ref raw))
{
if (i == 0)
{
throw new NetMQException(
"ReceiveMessage occurred but no data to receive");
}

break;
}

Expand Down Expand Up @@ -717,8 +723,9 @@ await ReplyMessageAsync(
{
_logger.Error(
ex,
"An unexpected exception occurred during {MethodName}()",
nameof(ReceiveMessage));
"An unexpected exception occurred during {MethodName}() {Sender}",
nameof(ReceiveMessage),
sender);
}
}

Expand Down

0 comments on commit 323abe7

Please sign in to comment.