| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Network.WebSockets.Connection.PingPong
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.
Constructors
| PingPongOptions | |
Fields
| |
data PongTimeout Source #
Exception type used to kill connections if there is a pong timeout.
Constructors
| PongTimeout |
Instances
| Exception PongTimeout Source # | |
Defined in Network.WebSockets.Connection.PingPong Methods toException :: PongTimeout -> SomeException # fromException :: SomeException -> Maybe PongTimeout # displayException :: PongTimeout -> String # | |
| Show PongTimeout Source # | |
Defined in Network.WebSockets.Connection.PingPong Methods 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