hosc-0.13: Haskell Open Sound Control

Safe HaskellNone

Sound.OSC.Transport.FD

Contents

Description

An abstract transport layer with implementations for UDP and TCP transport.

Synopsis

Documentation

class Transport t whereSource

Abstract over the underlying transport protocol.

Methods

sendOSC :: OSC o => t -> o -> IO ()Source

Encode and send an OSC packet.

recvPacket :: t -> IO PacketSource

Receive and decode an OSC packet.

close :: t -> IO ()Source

Close an existing connection.

withTransport :: Transport t => IO t -> (t -> IO a) -> IO aSource

Bracket OSC communication.

Send

sendMessage :: Transport t => t -> Message -> IO ()Source

Type restricted synonym for sendOSC.

sendBundle :: Transport t => t -> Bundle -> IO ()Source

Type restricted synonym for sendOSC.

Receive

recvOSC :: (Transport t, OSC o) => t -> IO (Maybe o)Source

Variant of recvPacket that runs fromPacket.

recvBundle :: Transport t => t -> IO BundleSource

Variant of recvPacket that runs packet_to_bundle.

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

waitUntil :: Transport t => t -> (Packet -> Bool) -> IO PacketSource

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

waitFor :: Transport t => t -> (Packet -> Maybe a) -> IO aSource

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

waitMessage :: Transport t => t -> IO MessageSource

waitFor packet_to_message, ie. an incoming Message or immediate mode Bundle with one element.

waitAddress :: Transport t => t -> Address_Pattern -> IO PacketSource

A waitFor for variant using packet_has_address to match on the Address_Pattern of incoming Packets.

waitReply :: Transport t => t -> Address_Pattern -> IO MessageSource

Variant on waitAddress that returns matching Message.

waitDatum :: Transport t => t -> Address_Pattern -> IO [Datum]Source

Variant of waitReply that runs messageDatum.