on master help sign in
Merge pull request #199 from banacorn/master
ca598edMichael Snoyman
wai-websockets/Network/Wai/Handler/WebSockets.hs+1−15
@@ -57,27 +57,13 @@ runWebSockets opts req app _ conn = do
57 let pc = WS.PendingConnection
57 let pc = WS.PendingConnection
58 { WS.pendingOptions = opts
58 { WS.pendingOptions = opts
59 , WS.pendingRequest = req
59 , WS.pendingRequest = req
60− , WS.pendingOnAccept = forkPingThread
60+ , WS.pendingOnAccept = \_ -> return ()
61 , WS.pendingIn = is
61 , WS.pendingIn = is
62 , WS.pendingOut = os
62 , WS.pendingOut = os
63 }
63 }
64
64
65 liftIO $ app pc
65 liftIO $ app pc
66
66
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−
81------------------------------------------------------------------------------
67------------------------------------------------------------------------------
82-- | Converts a 'Connection' to an 'InputStream' \/ 'OutputStream' pair. Note that,
68-- | Converts a 'Connection' to an 'InputStream' \/ 'OutputStream' pair. Note that,
83-- as is usually the case in @io-streams@, writing a 'Nothing' to the generated
69-- 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 @@
1Name: wai-websockets
1Name: wai-websockets
2−Version: 1.3.2.0
2+Version: 1.3.2.1
3Synopsis: Provide a bridge betweeen WAI and the websockets package.
3Synopsis: Provide a bridge betweeen WAI and the websockets package.
4License: MIT
4License: MIT
5License-file: LICENSE
5License-file: LICENSE