aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2026-10-08 21:03:56 -0500
committerJP Dillingham <jp@dillingham.me>2026-10-08 21:03:56 -0500
commit75fb01e431292bf2e43639506364a74bbab1fbdb (patch)
tree242c29d677c67ca3b1f63a69595789932e16a823
parent6490ca194b7ca5d9b110d82ebbf5fe86e1af015d (diff)
downloadslskd-75fb01e431292bf2e43639506364a74bbab1fbdb.tar.gz
apply custom MTU if specified
-rw-r--r--src/slskd/Application.cs20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/slskd/Application.cs b/src/slskd/Application.cs
index 9d172a76..51289970 100644
--- a/src/slskd/Application.cs
+++ b/src/slskd/Application.cs
@@ -418,7 +418,15 @@ namespace slskd
// os-specific keepalive is configured for long-lived connections for the server and distributed parent/children
var serverOptions = connectionOptions.With(
inactivityTimeout: -1, // don't disconnect due to inactivity
- configureSocket: socket => ConfigureSocketKeepaliveOptions(socket, OptionsAtStartup.Soulseek.Connection));
+ configureSocket: socket =>
+ {
+ ConfigureSocketKeepaliveOptions(socket, OptionsAtStartup.Soulseek.Connection);
+
+ if (OptionsAtStartup.Soulseek.Connection.Mtu.HasValue)
+ {
+ ConfigureSocketMtu(socket, OptionsAtStartup.Soulseek.Connection.Mtu.Value);
+ }
+ });
var distributedOptions = connectionOptions.With(
writeQueueSize: OptionsAtStartup.Soulseek.Connection.Buffer.WriteQueue, // write queue set to keep distributed children from impacting performance
@@ -1614,7 +1622,15 @@ namespace slskd
serverPatch = connectionPatch.With(
inactivityTimeout: -1, // don't disconnect due to inactivity
- configureSocket: socket => ConfigureSocketKeepaliveOptions(socket, options: connection));
+ configureSocket: socket =>
+ {
+ ConfigureSocketKeepaliveOptions(socket, options: connection);
+
+ if (connection.Mtu.HasValue)
+ {
+ ConfigureSocketMtu(socket, connection.Mtu.Value);
+ }
+ });
distributedPatch = connectionPatch.With(
writeQueueSize: connection.Buffer.WriteQueue, // write queue set to keep distributed children from impacting performance