websockets-0.13.0.0: A sensible and clean way to write WebSocket-capable servers in Haskell.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Network.WebSockets.Connection.PingPong

Synopsis

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 

defaultPingPongOptions :: PingPongOptions Source #

Default options for ping-pong

Ping every 15 seconds, timeout after 30 seconds