This module provides the low-level interface for communicating with a metaverse server. It handles the details of packet encoding, accounting, handshaking, and so on.
In general, you should try to use the higher-level functions in the Network.Metaverse module as often as possible, and fall down to this level only when there is no other option.
- data Circuit
- circuitConnect :: MVToken -> IO Circuit
- circuitAgentID :: Circuit -> UUID
- circuitSessionID :: Circuit -> UUID
- circuitCode :: Circuit -> Word32
- circuitSend :: Circuit -> Bool -> PacketBody -> IO ()
- circuitSendSync :: Circuit -> PacketBody -> IO Bool
- circuitIncoming :: Circuit -> Chan (Maybe PacketBody)
- circuitClose :: Circuit -> IO ()
- circuitIsClosed :: Circuit -> IO Bool
Connects to a circuit, using connection information given in the login token provided. This sets up all the accounting and other data structures associated with the circuit and gets it all started.
Gives the circuit code, a 32-bit integer, associated with this circuit. This is only rarely used, but it occasionally needed.
The circuit to send on
Whether to send reliably. While this function
never waits for a response, a value of
The packet contents to send
|-> IO ()|
Sends a packet to the server, but does not wait for a response.
Sends a packet to the server, and waits for acknowledgement.
Gives the channel used to provide incoming packets from the server.
In general it is not used directly, but rather in conjunction with
dupChan so that each piece of the client can operate independently
with respect to all of the others.
When the circuit is closed,
Nothing is written to this channel.
Closes a circuit, terminating its threads, closing its network resources, and cleaning up after it.