Skip to content

Commit

Permalink
feat: force reply Pong
Browse files Browse the repository at this point in the history
  • Loading branch information
limebell committed Dec 12, 2024
1 parent 4778de3 commit 87973e4
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/Libplanet.Net/Transports/NetMQTransport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,23 @@ await ReplyMessageAsync(
exc,
"Something went wrong during message processing. {@Frames}",
copied.ToArray());

if (e.Socket.TrySendMultipartMessage(
_messageCodec.Encode(
new PongMsg(),
_privateKey,
_appProtocolVersionOptions.AppProtocolVersion,
AsPeer,
DateTimeOffset.UtcNow)))
{
_logger.Debug("Socket reply has sent to {Socket}", e.Socket);
}
else
{
_logger.Debug(
"Socket reply failed to send to {Socket}",
e.Socket);
}
}
},
CancellationToken.None,
Expand Down

0 comments on commit 87973e4

Please sign in to comment.