Copyright | (c) 2018-2019 Commonwealth Scientific and Industrial Research Organisation |
---|---|
License | BSD3 |
Maintainer | dave.laing.80@gmail.com, jack.kelly@data61.csiro.au |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- accept :: (Reflex t, PerformEvent t m, PostBuild t m, TriggerEvent t m, MonadIO (Performable m), MonadIO m) => AcceptConfig t -> m (Event t (Either SetupError (Accept t)))
- data AcceptConfig t = AcceptConfig {
- _acHostname :: Maybe HostName
- _acService :: Maybe ServiceName
- _acListenQueue :: Int
- _acSocketOptions :: [(SocketOption, Int)]
- _acClose :: Event t ()
- data Accept t = Accept {
- _aAcceptSocket :: Event t (Socket, SockAddr)
- _aClose :: Event t ()
- _aError :: Event t IOException
- acHostname :: forall t. Lens' (AcceptConfig t) (Maybe HostName)
- acService :: forall t. Lens' (AcceptConfig t) (Maybe ServiceName)
- acListenQueue :: forall t. Lens' (AcceptConfig t) Int
- acSocketOptions :: forall t. Lens' (AcceptConfig t) [(SocketOption, Int)]
- acClose :: forall t t. Lens (AcceptConfig t) (AcceptConfig t) (Event t ()) (Event t ())
- aAcceptSocket :: forall t. Lens' (Accept t) (Event t (Socket, SockAddr))
- aClose :: forall t. Lens' (Accept t) (Event t ())
- aError :: forall t. Lens' (Accept t) (Event t IOException)
Documentation
:: (Reflex t, PerformEvent t m, PostBuild t m, TriggerEvent t m, MonadIO (Performable m), MonadIO m) | |
=> AcceptConfig t | |
-> m (Event t (Either SetupError (Accept t))) | This event will fire exactly once. |
Create a listening socket. Sockets are accepted in a background thread.
Listen socket configuration
data AcceptConfig t Source #
Configuration of a listen socket.
AcceptConfig | |
|
Results of accept
Events produced by a running listen socket.
Accept | |
|
Lenses
AcceptConfig
acHostname :: forall t. Lens' (AcceptConfig t) (Maybe HostName) Source #
acService :: forall t. Lens' (AcceptConfig t) (Maybe ServiceName) Source #
acListenQueue :: forall t. Lens' (AcceptConfig t) Int Source #
acSocketOptions :: forall t. Lens' (AcceptConfig t) [(SocketOption, Int)] Source #
acClose :: forall t t. Lens (AcceptConfig t) (AcceptConfig t) (Event t ()) (Event t ()) Source #