From 8aa15e3b5c606eb7820baf73ab170d43e10adbbd Mon Sep 17 00:00:00 2001 From: Benjamin Summers Date: Thu, 19 Dec 2019 04:43:40 -0800 Subject: [PATCH] Use ping thread to keep websocket connection alive. --- pkg/king/lib/Vere/NounServ.hs | 3 ++- stack.yaml | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/king/lib/Vere/NounServ.hs b/pkg/king/lib/Vere/NounServ.hs index fc3ad9896..031fff441 100644 --- a/pkg/king/lib/Vere/NounServ.hs +++ b/pkg/king/lib/Vere/NounServ.hs @@ -91,7 +91,8 @@ wsClient pax por = do tid <- io $ async $ WS.runClient "127.0.0.1" por (unpack pax) - $ runRIO env . wsConn "NOUNSERV (wsClie) " inp out + $ \con -> WS.withPingThread con 15 (pure ()) $ + runRIO env (wsConn "NOUNSERV (wsClie) " inp out con) pure $ Client con tid diff --git a/stack.yaml b/stack.yaml index ee5550ab4..cf3f72dbf 100644 --- a/stack.yaml +++ b/stack.yaml @@ -11,6 +11,7 @@ extra-deps: - lock-file-0.7.0.0@sha256:3ad84b5e454145e1d928063b56abb96db24a99a21b493989520e58fa0ab37b00 - urbit-hob-0.3.0@sha256:4871bd8ad01171ae5d4e50a344f4b8757e9eee80f62ab40a80f5311cd443b115 - para-1.1@sha256:a90eebb063ad70271e6e2a7f00a93e8e8f8b77273f100f39852fbf8301926f81 + - websockets-0.12.6.1@sha256:3816e841d8102877817d24ef5c96288e79f1323434268b866aa40732cc86763f nix: packages: