on master help sign in
Merge pull request #199 from banacorn/master

Remove `forkPingThread` callback

commitca598ed680fe2ce077026237b0050ee1517a2e3f authorMichael Snoyman <michael@snoyman.com> dateWed 20 Nov 2013, 02:41 (13 years ago) parent050109e5888acd
2 files changed+2−16
wai-websockets/Network/Wai/Handler/WebSockets.hs+1−15 wai-websockets/wai-websockets.cabal+1−1
wai-websockets/Network/Wai/Handler/WebSockets.hs+1−15
@@ -57,27 +57,13 @@ runWebSockets opts req app _ conn = do
5757 let pc = WS.PendingConnection
5858 { WS.pendingOptions = opts
5959 , WS.pendingRequest = req
60− , WS.pendingOnAccept = forkPingThread
60+ , WS.pendingOnAccept = \_ -> return ()
6161 , WS.pendingIn = is
6262 , WS.pendingOut = os
6363 }
6464
6565 liftIO $ app pc
6666
67−--------------------------------------------------------------------------------
68−-- | Start a ping thread in the background
69−forkPingThread :: WS.Connection -> IO ()
70−forkPingThread conn = do
71− _ <- forkIO pingThread
72− return ()
73− where
74− pingThread = handle ignore $ forever $ do
75− WS.sendPing conn (BC.pack "ping")
76− threadDelay $ 30 * 1000 * 1000
77−
78− ignore :: SomeException -> IO ()
79− ignore _ = return ()
80−
8167------------------------------------------------------------------------------
8268-- | Converts a 'Connection' to an 'InputStream' \/ 'OutputStream' pair. Note that,
8369-- as is usually the case in @io-streams@, writing a 'Nothing' to the generated
wai-websockets/wai-websockets.cabal+1−1
@@ -1,5 +1,5 @@
11Name: wai-websockets
2−Version: 1.3.2.0
2+Version: 1.3.2.1
33Synopsis: Provide a bridge betweeen WAI and the websockets package.
44License: MIT
55License-file: LICENSE