fix: Adds more NetState dumping for debug (#1795)

This commit is contained in:
Kamron Batman 2024-05-27 12:10:27 -07:00 committed by GitHub
parent 21c5e46565
commit ccad915464
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 30 deletions

View file

@ -26,13 +26,13 @@ public static class DumpNetStates
public static void DumpNetStatesCommand(CommandEventArgs args)
{
using var file = new StreamWriter("netstatedump.csv");
using var file = new StreamWriter($"netstatedump-{Core.Now:yyyy-M-d-HH-mm-ss}_{Core.TickCount}.csv");
file.WriteLine("NetState, RecvTask, SendTask, ProtocolState, ParserState");
file.WriteLine("NetState, ConnectedOn, NextActivityCheck, SocketConnected, ProtocolState, ParserState");
foreach (var ns in NetState.Instances)
{
file.WriteLine($"{ns}, {ns._protocolState}, {ns._parserState}");
file.WriteLine($"{ns}, {ns.ConnectedOn}, {ns.NextActivityCheck}, {ns.Connection.Connected}, {ns._protocolState}, {ns._parserState}");
}
}
}