Safe Haskell | None |
---|---|
Language | Haskell98 |
An abstract transport layer with implementations for UDP
and TCP
transport.
- class Transport t where
- withTransport :: Transport t => IO t -> (t -> IO a) -> IO a
- sendMessage :: Transport t => t -> Message -> IO ()
- sendBundle :: Transport t => t -> Bundle -> IO ()
- recvOSC :: (Transport t, OSC o) => t -> IO (Maybe o)
- recvBundle :: Transport t => t -> IO Bundle
- recvMessage :: Transport t => t -> IO (Maybe Message)
- recvMessages :: Transport t => t -> IO [Message]
- recvPacketTimeout :: Transport t => Double -> t -> IO (Maybe Packet)
- waitUntil :: Transport t => t -> (Packet -> Bool) -> IO Packet
- waitFor :: Transport t => t -> (Packet -> Maybe a) -> IO a
- waitImmediate :: Transport t => t -> IO Packet
- waitMessage :: Transport t => t -> IO Message
- waitAddress :: Transport t => t -> Address_Pattern -> IO Packet
- 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.
Send
Receive
recvOSC :: (Transport t, OSC o) => t -> IO (Maybe o) Source #
Variant of recvPacket
that runs fromPacket
.
recvBundle :: Transport t => t -> IO Bundle 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
.
Timeout
recvPacketTimeout :: Transport t => Double -> t -> IO (Maybe Packet) Source #
Variant of recvPacket
that implements an n second timeout
.
Wait
waitMessage :: Transport t => t -> IO Message Source #
waitFor
packet_to_message
, ie. an incoming Message
or
immediate mode Bundle
with one element.
waitAddress :: Transport t => t -> Address_Pattern -> IO Packet 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
.