Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
An abstract transport layer with implementations for Udp
and Tcp
transport.
Synopsis
- class Transport t where
- sendPacket :: t -> PacketOf Message -> IO ()
- recvPacket :: t -> IO (PacketOf Message)
- recvPacketOr :: t -> IO (Either String Packet)
- close :: t -> IO ()
- withTransport :: Transport t => IO t -> (t -> IO a) -> IO a
- sendMessage :: Transport t => t -> Message -> IO ()
- sendBundle :: Transport t => t -> BundleOf Message -> IO ()
- recvBundle :: Transport t => t -> IO (BundleOf Message)
- recvMessage :: Transport t => t -> IO (Maybe Message)
- recvMessage_err :: Transport t => t -> IO Message
- recvMessages :: Transport t => t -> IO [Message]
- waitUntil :: Transport t => t -> (PacketOf Message -> Bool) -> IO (PacketOf Message)
- waitFor :: Transport t => t -> (PacketOf Message -> Maybe a) -> IO a
- waitImmediate :: Transport t => t -> IO (PacketOf Message)
- waitMessage :: Transport t => t -> IO Message
- waitAddress :: Transport t => t -> Address_Pattern -> IO (PacketOf Message)
- waitReply :: Transport t => t -> Address_Pattern -> IO Message
- waitDatum :: Transport t => t -> Address_Pattern -> IO [Datum]
Documentation
class Transport t where Source #
Abstract over the underlying transport protocol.
sendPacket :: t -> PacketOf Message -> IO () Source #
Encode and send an Osc packet.
recvPacket :: t -> IO (PacketOf Message) Source #
Receive and decode an Osc packet.
recvPacketOr :: t -> IO (Either String Packet) Source #
Receive and either decode an Osc packet.
Close an existing connection.
Send
Receive
recvBundle :: Transport t => t -> IO (BundleOf Message) Source #
Variant of recvPacket
that runs packet_to_bundle
.
recvMessage :: Transport t => t -> IO (Maybe Message) Source #
Variant of recvPacket
that runs packet_to_message
.
recvMessages :: Transport t => t -> IO [Message] Source #
Variant of recvPacket
that runs packetMessages
.
Wait
waitMessage :: Transport t => t -> IO Message Source #
waitFor
packet_to_message
, ie. an incoming Message
or
immediate mode BundleOf
with one element.
waitAddress :: Transport t => t -> Address_Pattern -> IO (PacketOf Message) Source #
A waitFor
for variant using packet_has_address
to match on
the Address_Pattern
of incoming Packets
.
waitReply :: Transport t => t -> Address_Pattern -> IO Message Source #
Variant on waitAddress
that returns matching Message
.
waitDatum :: Transport t => t -> Address_Pattern -> IO [Datum] Source #
Variant of waitReply
that runs messageDatum
.