hosc-0.17: Haskell Open Sound Control

Safe HaskellNone
LanguageHaskell98

Sound.OSC.Transport.FD.TCP

Description

OSC over TCP implementation.

Synopsis

Documentation

data TCP Source #

The TCP transport handle data type.

Constructors

TCP 

Fields

Instances
Transport TCP Source #

TCP is an instance of Transport.

Instance details

Defined in Sound.OSC.Transport.FD.TCP

tcp_send_packet :: TCP -> Packet -> IO () Source #

Send packet over TCP.

tcp_recv_packet :: TCP -> IO Packet Source #

Receive packet over TCP.

tcp_close :: TCP -> IO () Source #

Close TCP.

with_tcp :: IO TCP -> (TCP -> IO t) -> IO t Source #

Bracket UDP communication.

tcp_socket :: (Socket -> SockAddr -> IO ()) -> Maybe String -> Int -> IO Socket Source #

Create and initialise TCP socket.

tcp_handle :: (Socket -> SockAddr -> IO ()) -> String -> Int -> IO TCP Source #

Create and initialise TCP.

openTCP :: String -> Int -> IO TCP Source #

Make a TCP connection.

import Sound.OSC.Datum 
import Sound.OSC.Time 
let t = openTCP "127.0.0.1" 57110
let m1 = Packet.message "/dumpOSC" [Int32 1]
let m2 = Packet.message "/g_new" [Int32 1]
FD.withTransport t (\fd -> let f = FD.sendMessage fd in f m1 >> pauseThread 0.25 >> f m2)

tcp_server_f :: Socket -> (TCP -> IO ()) -> IO () Source #

accept connection at s and run f.

repeatM_ :: Monad m => m a -> m () Source #

tcp_server :: Int -> (TCP -> IO ()) -> IO () Source #

A trivial TCP OSC server.