hosc-0.21: Haskell Open Sound Control
Safe HaskellSafe-Inferred
LanguageHaskell2010

Sound.Osc.Transport.Fd

Description

An abstract transport layer with implementations for Udp and Tcp transport.

Synopsis

Documentation

class Transport t where Source #

Abstract over the underlying transport protocol.

Methods

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 :: t -> IO () Source #

Close an existing connection.

withTransport :: Transport t => IO t -> (t -> IO a) -> IO a Source #

Bracket Osc communication.

Send

Receive

recvMessage_err :: Transport t => t -> IO Message Source #

Erroring variant.

recvMessages :: Transport t => t -> IO [Message] Source #

Variant of recvPacket that runs packetMessages.

Wait

waitUntil :: Transport t => t -> (PacketOf Message -> Bool) -> IO (PacketOf Message) Source #

Wait for a Packet where the supplied predicate is True, discarding intervening packets.

waitFor :: Transport t => t -> (PacketOf Message -> Maybe a) -> IO a Source #

Wait for a Packet where the supplied function does not give Nothing, discarding intervening packets.

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.