SuperSimpleTcp icon indicating copy to clipboard operation
SuperSimpleTcp copied to clipboard

Timeout disconnection after 2mins

Open AndreaCashItaly opened this issue 2 months ago • 0 comments

Good morning, I made a TCP server initialized like this:

this._server = new SimpleTcpServer($"0.0.0.0:{Program.TCP_PORTA}");

this._server.Events.ClientConnected += _server_ClientConnected;
this._server.Events.ClientDisconnected += _server_ClientDisconnected;
this._server.Events.DataReceived += _server_DataReceived;
this._server.Events.DataSent += _server_DataSent;

The problem, is that after exactly 2 minutes of a client inactivity, I get the client disconnection.

I tried to set 'Idle' settings:

this._server.Settings.IdleClientEvaluationIntervalMs = 5000;
this._server.Settings.IdleClientTimeoutMs = 6000000;

I tried to set 'KeepAlive' settings:

this._server.Keepalive.EnableTcpKeepAlives = true;
this._server.Keepalive.TcpKeepAliveInterval = 5;
this._server.Keepalive.TcpKeepAliveTime = 5;
this._server.Keepalive.TcpKeepAliveRetryCount = 5;

But the problem is still here. I'm working on Windows 10 and .Net Framework 4.8

What's wrong?

Thanks in advance Andrea

AndreaCashItaly avatar Oct 31 '25 16:10 AndreaCashItaly