Skip to content

Commit

Permalink
Establish stricter client timeout (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexMacocian authored Nov 26, 2023
1 parent f211b3c commit 174794b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
4 changes: 2 additions & 2 deletions GuildWarsPartySearch/Launch/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ private static async Task Main()
.AddHandler(new HttpHandler()
.AddHttpModule(new ContentModule()))
.AddServerUsageMonitor(new TickrateEnforcer() { TicksPerSecond = 60, Silent = true })
.SetScheduler(new TaskAwaiterScheduler())
.SetScheduler(new FireTasksAndForgetScheduler())
.WithLoggingMessageContents(false);
var serverOptions = httpsServer.ServiceManager.GetRequiredService<IOptions<ServerOptions>>();
httpsServer.WithCertificate(serverOptions.Value.Certificate);
Expand All @@ -45,7 +45,7 @@ private static async Task Main()
httpServer.AddHandler(new HttpHandler()
.AddHttpModule(new ContentModule()))
.AddServerUsageMonitor(new TickrateEnforcer { TicksPerSecond = 10, Silent = true })
.SetScheduler(new TaskAwaiterScheduler())
.SetScheduler(new FireTasksAndForgetScheduler())
.WithLoggingMessageContents(false);

var httpsServerTask = httpsServer.RunAsync(CancellationTokenSource.Token);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,8 @@ void IHandler.Tick(MTSC.ServerSide.Server server)
{
if (DateTime.Now - client.LastActivityTime > inactivityTimeout)
{
if (!IsConnected(client.Socket))
{
server.Log("Disconnected: " + client.Socket.RemoteEndPoint?.ToString());
client.ToBeRemoved = true;
}
server.Log("Disconnected: " + client.Socket.RemoteEndPoint?.ToString());
client.ToBeRemoved = true;
}
}
}
Expand Down

0 comments on commit 174794b

Please sign in to comment.