diff --git a/src/Simplex/Messaging/Client.hs b/src/Simplex/Messaging/Client.hs index 151b77463..00cfc3b3b 100644 --- a/src/Simplex/Messaging/Client.hs +++ b/src/Simplex/Messaging/Client.hs @@ -114,7 +114,7 @@ smpDefaultConfig = defaultTransport = ("5223", transport @TLS), tcpTimeout = 4_000_000, tcpKeepAlive = Just defaultKeepAliveOpts, - smpPing = 600_000_000 -- 10min + smpPing = 300_000_000 -- 5 min } data Request = Request @@ -194,7 +194,7 @@ getSMPClient smpServer cfg@SMPClientConfig {qSize, tcpTimeout, tcpKeepAlive, smp ping :: SMPClient -> IO () ping c = forever $ do threadDelay smpPing - runExceptT $ sendSMPCommand c Nothing "" PING + void . either throwIO pure =<< runExceptT (sendSMPCommand c Nothing "" PING) process :: SMPClient -> IO () process SMPClient {rcvQ, sentCommands} = forever $ do diff --git a/src/Simplex/Messaging/Transport/KeepAlive.hs b/src/Simplex/Messaging/Transport/KeepAlive.hs index aa308492d..c949394a0 100644 --- a/src/Simplex/Messaging/Transport/KeepAlive.hs +++ b/src/Simplex/Messaging/Transport/KeepAlive.hs @@ -52,7 +52,7 @@ foreign import capi "netinet/tcp.h value TCP_KEEPINTVL" _TCP_KEEPINTVL :: CInt foreign import capi "netinet/tcp.h value TCP_KEEPCNT" _TCP_KEEPCNT :: CInt -#endif +#endif setSocketKeepAlive :: Socket -> KeepAliveOpts -> IO () setSocketKeepAlive sock KeepAliveOpts {keepCnt, keepIdle, keepIntvl} = do