etamoo

Safe HaskellNone
LanguageHaskell2010

MOO.Connection

Synopsis

Documentation

type ConnectionHandler = ConnectionName -> (Producer ByteString IO (), Consumer ByteString IO ()) -> IO () Source

firstConnectionId :: ObjId Source

The first un-logged-in connection ID. Avoid conflicts with #-1 ($nothing), -3 ($failed_match).

withConnections :: (Map ObjId Connection -> MOO a) -> MOO a Source

Do something with the Map of all active connections.

withConnection :: ObjId -> (Connection -> MOO a) -> MOO a Source

Do something with the connection for the given object, raising E_INVARG if no such connection exists.

withMaybeConnection :: ObjId -> (Maybe Connection -> MOO a) -> MOO a Source

Do something with the connection for given object, if any.

connectionName :: Connection -> ConnectionName Source

closeConnection :: Connection -> STM () Source

Initiate the closing of a connection by closing its output queue.

notify :: ObjId -> StrT -> MOO Bool Source

Send data to a connection, flushing if necessary.

notify' :: Bool -> ObjId -> StrT -> MOO Bool Source

Send data to a connection, optionally without flushing.

bufferedOutputLength :: Maybe Connection -> STM Int Source

Return the number of items currently buffered for output to a connection, or the maximum number of items that will be buffered up for output on any connection.

forceInput :: Bool -> ObjId -> StrT -> MOO () Source

Force a line of input for a connection.

flushInput :: Bool -> Connection -> STM () Source

Flush a connection's input queue, optionally showing what was flushed.

bootPlayer :: ObjId -> MOO () Source

Close the connection associated with an object.

bootPlayer' :: Bool -> ObjId -> MOO () Source

Close the connection associated with an object, with message varying on whether the object is being recycled.

setConnectionOption :: ObjId -> Id -> Value -> MOO () Source

Set a connection option for an active connection.

getConnectionOptions :: ObjId -> MOO (Map Id Value) Source

Return a Map of all currently set connection options for a connection.