Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- withPingPong :: PingPongOptions -> Connection -> (Connection -> IO ()) -> IO ()
- data PingPongOptions = PingPongOptions {
- pingInterval :: Int
- pongTimeout :: Int
- pingAction :: IO ()
- data PongTimeout = PongTimeout
- defaultPingPongOptions :: PingPongOptions
Documentation
withPingPong :: PingPongOptions -> Connection -> (Connection -> IO ()) -> IO () Source #
Run an application with ping-pong enabled. Raises PongTimeout if a pong is not received.
Can used with Client and Server connections.
data PingPongOptions Source #
Options for ping-pong
Make sure that the ping interval is less than the pong timeout, for example N/2.
PingPongOptions | |
|
data PongTimeout Source #
Exception type used to kill connections if there is a pong timeout.
Instances
Exception PongTimeout Source # | |
Defined in Network.WebSockets.Connection.PingPong | |
Show PongTimeout Source # | |
Defined in Network.WebSockets.Connection.PingPong showsPrec :: Int -> PongTimeout -> ShowS # show :: PongTimeout -> String # showList :: [PongTimeout] -> ShowS # |
defaultPingPongOptions :: PingPongOptions Source #
Default options for ping-pong
Ping every 15 seconds, timeout after 30 seconds