License | BSD-3-Clause |
---|---|
Safe Haskell | None |
Language | GHC2021 |
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
)
KeepAliveFail | |
| |
KeepAliveTimeout |
Instances
(Typeable a, Show a) => Exception (KeepAliveFail a) Source # | |
Defined in M.IO.KeepAlive toException :: KeepAliveFail a -> SomeException # fromException :: SomeException -> Maybe (KeepAliveFail a) # displayException :: KeepAliveFail a -> String # | |
Show a => Show (KeepAliveFail a) Source # | |
Defined in M.IO.KeepAlive showsPrec :: Int -> KeepAliveFail a -> ShowS # show :: KeepAliveFail a -> String # showList :: [KeepAliveFail a] -> ShowS # | |
Eq a => Eq (KeepAliveFail a) Source # | |
Defined in M.IO.KeepAlive (==) :: 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:
KeepAliveFail
if response doesn't matchKeepAliveTimeout
if no response within timeout