Safe Haskell | None |
---|---|
Language | Haskell2010 |
Hans.Udp.State
Contents
- data UdpState = UdpState {
- udpRecv :: !(HashTable Key UdpBuffer)
- udpPorts :: !(MVar UdpPort)
- udpQueue_ :: !(BoundedChan UdpResponderRequest)
- newUdpState :: Config -> IO UdpState
- class HasUdpState udp where
- type UdpBuffer = Buffer (Device, Addr, UdpPort, Addr, UdpPort)
- lookupRecv :: HasUdpState state => state -> Addr -> UdpPort -> IO (Maybe UdpBuffer)
- registerRecv :: HasUdpState state => state -> Addr -> UdpPort -> UdpBuffer -> IO (Maybe (IO ()))
- nextUdpPort :: HasUdpState state => state -> Addr -> IO (Maybe UdpPort)
- data UdpResponderRequest = SendDatagram !(RouteInfo Addr) !Addr !UdpHeader !ByteString
- udpQueue :: HasUdpState state => Getting r state (BoundedChan UdpResponderRequest)
Documentation
Constructors
UdpState | |
Fields
|
Instances
lookupRecv :: HasUdpState state => state -> Addr -> UdpPort -> IO (Maybe UdpBuffer) Source #
registerRecv :: HasUdpState state => state -> Addr -> UdpPort -> UdpBuffer -> IO (Maybe (IO ())) Source #
Register a listener for messages to this address and port, returning Just
an action to unregister the listener on success.
nextUdpPort :: HasUdpState state => state -> Addr -> IO (Maybe UdpPort) Source #
Fast-path Resonder
data UdpResponderRequest Source #
Constructors
SendDatagram !(RouteInfo Addr) !Addr !UdpHeader !ByteString |
udpQueue :: HasUdpState state => Getting r state (BoundedChan UdpResponderRequest) Source #