From db80fcad9ffe47cc0349a01eb38093b3c4ad6862 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Tue, 23 Feb 2016 17:05:59 +0100 Subject: Added stability to websockets --- server/src/Thermoprint/Server/Push.hs | 1 + 1 file changed, 1 insertion(+) (limited to 'server/src') diff --git a/server/src/Thermoprint/Server/Push.hs b/server/src/Thermoprint/Server/Push.hs index b2eca6b..07b81fb 100644 --- a/server/src/Thermoprint/Server/Push.hs +++ b/server/src/Thermoprint/Server/Push.hs @@ -40,6 +40,7 @@ protocolSpec = CBS.pack $ "thermoprint-server.notification." ++ showVersion vers handleClient :: TChan Notification -> Connection -> IO () handleClient chan conn = do cChan <- atomically $ dupTChan chan + forkPingThread conn 10 forever . void $ atomically (readTChan cChan) >>= sendTextData conn . packNotification packNotification :: Notification -> Text -- cgit v1.2.3