Safe Haskell | None |
---|---|
Language | Haskell98 |
- data NetworkServer c w = NetworkServer {
- serverPort :: PortID
- eventsPerSecond :: Int
- onTick :: Handles -> Float -> w -> IO w
- onConnect :: Handles -> ConnectionId -> w -> IO w
- onDisconnect :: Handles -> ConnectionId -> w -> IO w
- onCommand :: Handles -> ConnectionId -> c -> w -> IO w
- data Handles
- data ConnectionId
- serverMain :: Binary c => NetworkServer c w -> w -> IO ()
- announce :: (MonadIO m, Binary c) => Handles -> c -> m ()
- announceOne :: (MonadIO m, Binary c) => Handles -> ConnectionId -> c -> m ()
Documentation
data NetworkServer c w Source
NetworkServer | |
|
:: Binary c | |
=> NetworkServer c w | callbacks and settings |
-> w | initial state value |
-> IO () |
Main entry point for server
Send a command to a collection of clients
:: (MonadIO m, Binary c) | |
=> Handles | Current set of handles |
-> ConnectionId | Index of handle to send to |
-> c | Message to send |
-> m () |
Send a command to a single client identified by id.