| License | BSD-3-Clause |
|---|---|
| Safe Haskell | None |
| Language | GHC2021 |
M.IO.KeepAlive
Contents
Description
This module implements the Minecraft protocol's keep-alive mechanism, which helps detect stale connections by periodically exchanging random numbers.
Synopsis
- data KeepAliveFail a
- = KeepAliveFail a a
- | KeepAliveTimeout
- skeepalive :: forall a (es :: [Effect]) void. (Concurrent :> es, Talking' es, IOE :> es, Random a, Show a, Eq a, Pack a, Unpack a, Typeable a) => Eff es void
Types
data KeepAliveFail a Source #
keep-alive failure modes. Occurs when:
- the response number doesn't match the sent number (
KeepAliveFail) - no response is received within timeout (
KeepAliveTimeout)
Constructors
| KeepAliveFail | |
Fields
| |
| KeepAliveTimeout | |
Instances
| (Typeable a, Show a) => Exception (KeepAliveFail a) Source # | |
Defined in M.IO.KeepAlive Methods toException :: KeepAliveFail a -> SomeException # fromException :: SomeException -> Maybe (KeepAliveFail a) # displayException :: KeepAliveFail a -> String # backtraceDesired :: KeepAliveFail a -> Bool # | |
| Show a => Show (KeepAliveFail a) Source # | |
Defined in M.IO.KeepAlive Methods showsPrec :: Int -> KeepAliveFail a -> ShowS # show :: KeepAliveFail a -> String # showList :: [KeepAliveFail a] -> ShowS # | |
| Eq a => Eq (KeepAliveFail a) Source # | |
Defined in M.IO.KeepAlive Methods (==) :: KeepAliveFail a -> KeepAliveFail a -> Bool # (/=) :: KeepAliveFail a -> KeepAliveFail a -> Bool # | |
Keep-alive functions
skeepalive :: forall a (es :: [Effect]) void. (Concurrent :> es, Talking' es, IOE :> es, Random a, Show a, Eq a, Pack a, Unpack a, Typeable a) => Eff es void Source #
server's keep-alive mechanism. sends a random number every 15 seconds and verifies the client echoes it back correctly
throws:
KeepAliveFailif response doesn't matchKeepAliveTimeoutif no response within timeout