Safe Haskell | None |
---|---|
Language | Haskell98 |
OSC over TCP implementation.
Synopsis
- data TCP = TCP {}
- tcp_send_packet :: TCP -> Packet -> IO ()
- tcp_recv_packet :: TCP -> IO Packet
- tcp_close :: TCP -> IO ()
- with_tcp :: IO TCP -> (TCP -> IO t) -> IO t
- tcp_socket :: (Socket -> SockAddr -> IO ()) -> Maybe String -> Int -> IO Socket
- socket_to_tcp :: Socket -> IO TCP
- tcp_handle :: (Socket -> SockAddr -> IO ()) -> String -> Int -> IO TCP
- openTCP :: String -> Int -> IO TCP
- tcp_server_f :: Socket -> (TCP -> IO ()) -> IO ()
- repeatM_ :: Monad m => m a -> m ()
- tcp_server :: Int -> (TCP -> IO ()) -> IO ()
Documentation
The TCP transport handle data type.
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)