fix KeepAlive setting params for Tor client
MODIFY
WalletWasabi/Tor/Socks5/TorTcpConnectionFactory.cs
WalletWasabi/Tor/Socks5/TorTcpConnectionFactory.cs
@@ -71,9 +71,16 @@ public class TorTcpConnectionFactory
{
tcpClient = new(TorSocks5EndPoint.AddressFamily);
tcpClient.Client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.KeepAlive, true);
+ try
+ {
tcpClient.Client.SetSocketOption(SocketOptionLevel.Tcp, SocketOptionName.TcpKeepAliveTime, 30);
tcpClient.Client.SetSocketOption(SocketOptionLevel.Tcp, SocketOptionName.TcpKeepAliveInterval, 5);
tcpClient.Client.SetSocketOption(SocketOptionLevel.Tcp, SocketOptionName.TcpKeepAliveRetryCount, 5);
+ }
+ catch (SocketException e)
+ {
+ Logger.LogError("Exception occurred when setting keepAlive params.", e);
+ }
transportStream = await ConnectAsync(tcpClient, cancellationToken).ConfigureAwait(false);
await HandshakeAsync(tcpClient, circuit, cancellationToken).ConfigureAwait(false);

fix KeepAlive setting params for Tor client