From 87973e47176007bcc71d1faab68416d715c2e1af Mon Sep 17 00:00:00 2001 From: Chanhyuck Ko Date: Thu, 12 Dec 2024 14:41:22 +0900 Subject: [PATCH] feat: force reply Pong --- src/Libplanet.Net/Transports/NetMQTransport.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/Libplanet.Net/Transports/NetMQTransport.cs b/src/Libplanet.Net/Transports/NetMQTransport.cs index b3e1cfa211..dd7a3d365f 100644 --- a/src/Libplanet.Net/Transports/NetMQTransport.cs +++ b/src/Libplanet.Net/Transports/NetMQTransport.cs @@ -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,