module Sound.Osc.Time.Timeout where
import System.Timeout
import Sound.Osc.Packet
import Sound.Osc.Transport.Fd
timeout_r :: Double -> IO a -> IO (Maybe a)
timeout_r :: forall a. Double -> IO a -> IO (Maybe a)
timeout_r = forall a. Int -> IO a -> IO (Maybe a)
timeout forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (RealFrac a, Integral b) => a -> b
floor forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall a. Num a => a -> a -> a
* Double
1000000)
recvPacketTimeout :: Transport t => Double -> t -> IO (Maybe Packet)
recvPacketTimeout :: forall t. Transport t => Double -> t -> IO (Maybe Packet)
recvPacketTimeout Double
n t
fd = forall a. Double -> IO a -> IO (Maybe a)
timeout_r Double
n (forall t. Transport t => t -> IO Packet
recvPacket t
fd)