I'm check sources and found KeepAlive method, then change PingInterval to -60 in my app and it's work, disconnects gone.
(negative value mean using simple ping instead PingDelayDisconnect )
if (PingInterval <= 0)
await this.Ping(ping_id++);
6 times - Unable to read data from the transport connection: Connection timed out
12 times - Could not read payload length : Connection shut down
2 times - Unable to read data from the transport connection: Connection reset by peer
now it looks like normal stable behavior
but not sure how it work, maybe thread pool was busy this 15 seconds or network card, or something in SendAsync wrong
(old results)
613 times - Unable to read data from the transport connection: Connection reset by peer
837 times - Could not read payload length : Connection shut down reactor error
I found solution for https://github.com/wiz0u/WTelegramClient/issues/287 and probably for https://github.com/wiz0u/WTelegramClient/issues/286
I'm check sources and found KeepAlive method, then change PingInterval to -60 in my app and it's work, disconnects gone. (negative value mean using simple ping instead PingDelayDisconnect )
https://github.com/wiz0u/WTelegramClient/blob/4f9accdfc80bc1e3d93f08bb1b156d217b042fd6/src/Client.cs#L993
new results = 8 hours still 2500+ instances
6 times - Unable to read data from the transport connection: Connection timed out 12 times - Could not read payload length : Connection shut down 2 times - Unable to read data from the transport connection: Connection reset by peer
now it looks like normal stable behavior but not sure how it work, maybe thread pool was busy this 15 seconds or network card, or something in SendAsync wrong
(old results) 613 times - Unable to read data from the transport connection: Connection reset by peer 837 times - Could not read payload length : Connection shut down reactor error