aboutsummaryrefslogtreecommitdiff
path: root/server/src
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2016-02-23 17:05:59 +0100
committerGregor Kleen <gkleen@yggdrasil.li>2016-02-23 17:05:59 +0100
commitdb80fcad9ffe47cc0349a01eb38093b3c4ad6862 (patch)
treecea0e212fc9f141d4e1e7b3005bfb3a5aba4c3f2 /server/src
parent2c55c6f2afabde93a3579d1042f189f34e821753 (diff)
downloadthermoprint-db80fcad9ffe47cc0349a01eb38093b3c4ad6862.tar
thermoprint-db80fcad9ffe47cc0349a01eb38093b3c4ad6862.tar.gz
thermoprint-db80fcad9ffe47cc0349a01eb38093b3c4ad6862.tar.bz2
thermoprint-db80fcad9ffe47cc0349a01eb38093b3c4ad6862.tar.xz
thermoprint-db80fcad9ffe47cc0349a01eb38093b3c4ad6862.zip
Added stability to websockets
Diffstat (limited to 'server/src')
-rw-r--r--server/src/Thermoprint/Server/Push.hs1
1 files changed, 1 insertions, 0 deletions
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
40handleClient :: TChan Notification -> Connection -> IO () 40handleClient :: TChan Notification -> Connection -> IO ()
41handleClient chan conn = do 41handleClient chan conn = do
42 cChan <- atomically $ dupTChan chan 42 cChan <- atomically $ dupTChan chan
43 forkPingThread conn 10
43 forever . void $ atomically (readTChan cChan) >>= sendTextData conn . packNotification 44 forever . void $ atomically (readTChan cChan) >>= sendTextData conn . packNotification
44 45
45packNotification :: Notification -> Text 46packNotification :: Notification -> Text