hosc-0.16: 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.

Methods

sendOSC :: OSC o => TCP -> o -> IO () Source #

recvPacket :: TCP -> IO Packet Source #

close :: TCP -> IO () Source #

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

Make a TCP connection.

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

tcpServer' :: Int -> (TCP -> IO ()) -> IO () Source #

A trivial TCP OSC server.