diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2016-02-23 17:05:59 +0100 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2016-02-23 17:05:59 +0100 |
commit | db80fcad9ffe47cc0349a01eb38093b3c4ad6862 (patch) | |
tree | cea0e212fc9f141d4e1e7b3005bfb3a5aba4c3f2 /server | |
parent | 2c55c6f2afabde93a3579d1042f189f34e821753 (diff) | |
download | thermoprint-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')
-rw-r--r-- | server/src/Thermoprint/Server/Push.hs | 1 |
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 | |||
40 | handleClient :: TChan Notification -> Connection -> IO () | 40 | handleClient :: TChan Notification -> Connection -> IO () |
41 | handleClient chan conn = do | 41 | handleClient 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 | ||
45 | packNotification :: Notification -> Text | 46 | packNotification :: Notification -> Text |