Copyright | (c) axionbuster 2025 |
---|---|
License | BSD-3-Clause |
Safe Haskell | None |
Language | GHC2021 |
Provides high-level IO operations and types for handling Minecraft protocol connections, including socket management and data streaming.
Synopsis
- data Connection = Connection {
- cxkey :: TVar (Maybe ByteString)
- cxcompth :: TVar Int
- cxinput :: InputStream Uninterpreted
- cxoutput :: OutputStream Uninterpreted
- data Uninterpreted = Uninterpreted {
- pkcode :: !Word8
- pkdata :: !ByteString
- module M.IO.Internal.EffectTypes
- withtalkingserver :: forall (es :: [Effect]) a. (IOE :> es, State ParserState :> es, Concurrent :> es, NonDet :> es) => UnliftStrategy -> Maybe String -> String -> Eff (Talking ': es) a -> Eff es a
- withtalkingclient :: forall (es :: [Effect]) a. (IOE :> es, State ParserState :> es, Concurrent :> es, NonDet :> es) => UnliftStrategy -> String -> String -> Eff (Talking ': es) a -> Eff es a
- withcxfromsocket :: Socket -> (Connection -> IO a) -> IO a
Documentation
data Connection Source #
a connection to either a server or a client
Connection | |
|
data Uninterpreted Source #
uninterpreted packet
Uninterpreted | |
|
Instances
define communication effects
module M.IO.Internal.EffectTypes
:: forall (es :: [Effect]) a. (IOE :> es, State ParserState :> es, Concurrent :> es, NonDet :> es) | |
=> UnliftStrategy | unlift strategy |
-> Maybe String | host (Nothing = all interfaces) |
-> String | port |
-> Eff (Talking ': es) a | per-connection handler |
-> Eff es a | final result |
run server accepting multiple connections
:: forall (es :: [Effect]) a. (IOE :> es, State ParserState :> es, Concurrent :> es, NonDet :> es) | |
=> UnliftStrategy | unlift strategy |
-> String | host |
-> String | port |
-> Eff (Talking ': es) a | handler |
-> Eff es a | result |
run client with single connection
withcxfromsocket :: Socket -> (Connection -> IO a) -> IO a Source #
create a connection from a socket