Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Osc over Tcp implementation.
Synopsis
- newtype Tcp = Tcp {}
- tcp_send_data :: Tcp -> ByteString -> IO ()
- 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 ()
- tcp_server :: Int -> (Tcp -> IO ()) -> IO ()
Documentation
The Tcp transport handle data type.
tcp_send_data :: Tcp -> ByteString -> IO () Source #
Send data over Tcp.
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)