Safe Haskell | None |
---|---|
Language | Haskell98 |
- type UdpHandle = Channel (Udp ())
- data UdpException
- runUdpLayer :: UdpHandle -> IP4Handle -> Icmp4Handle -> IO ()
- queueUdp :: UdpHandle -> IP4Header -> ByteString -> IO ()
- sendUdp :: UdpHandle -> IP4 -> Maybe UdpPort -> UdpPort -> ByteString -> IO ()
- type Handler = IP4 -> UdpPort -> ByteString -> IO ()
- addUdpHandler :: UdpHandle -> UdpPort -> Handler -> IO ()
- addUdpHandlerAnyPort :: UdpHandle -> (UdpPort -> Handler) -> IO UdpPort
- removeUdpHandler :: UdpHandle -> UdpPort -> IO ()
Documentation
runUdpLayer :: UdpHandle -> IP4Handle -> Icmp4Handle -> IO () Source
queueUdp :: UdpHandle -> IP4Header -> ByteString -> IO () Source
Queue an incoming udp message from the IP4 layer.
sendUdp :: UdpHandle -> IP4 -> Maybe UdpPort -> UdpPort -> ByteString -> IO () Source
Send a UDP datagram. When the source port is given, this will send using that source port. If the source port is not given, a fresh one is used, and immediately recycled.
NOTE: this doesn't prevent you from sending messages on a port that another thread is already using. This is a funky design, and we'd be better suited by introducing a UdpSocket type.
addUdpHandler :: UdpHandle -> UdpPort -> Handler -> IO () Source
Add a handler for incoming udp datagrams on a specific port.
addUdpHandlerAnyPort :: UdpHandle -> (UdpPort -> Handler) -> IO UdpPort Source
Add a handler for incoming udp datagrams on a freshly allocated port.
removeUdpHandler :: UdpHandle -> UdpPort -> IO () Source
Remove a handler present on the port given.