| Safe Haskell | None |
|---|
Sound.OSC.Transport.FD.UDP
Description
OSC over UDP implementation.
Documentation
The UDP transport handle data type.
udp_socket :: (Socket -> SockAddr -> IO ()) -> String -> Int -> IO UDPSource
Create and initialise UDP socket.
openUDP :: String -> Int -> IO UDPSource
Make a UDP connection.
let t = openUDP "127.0.0.1" 57110 in withTransport t (\fd -> recvT 0.5 fd >>= print)
udpServer :: String -> Int -> IO UDPSource
Trivial UDP server socket.
import Control.Concurrent
let {f fd = forever (recvMessage fd >>= print)
;t = udpServer "127.0.0.1" 57300}
in void (forkIO (withTransport t f))
let t = openUDP "127.0.0.1" 57300 in withTransport t (\fd -> sendMessage fd (message "/n" []))