| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Cardano.Logging.Prometheus.NetworkRun
Description
Run a TCP server, with hardening against connection flooding
Synopsis
- data NetworkRunParams = NetworkRunParams {
- runSocketTimeout :: !Int
- runSocketGraceful :: !Int
- runRecvMaxSize :: !Int
- runRateLimit :: !Double
- runConnLimitGlobal :: !Int
- runConnLimitPerHost :: !Int
- runServerName :: !String
- type TimeoutServer a = NetworkRunParams -> IO () -> Socket -> IO a
- defaultRunParams :: String -> NetworkRunParams
- mkTCPServerRunner :: NetworkRunParams -> Maybe HostName -> PortNumber -> TimeoutServer () -> IO (IO ())
Documentation
data NetworkRunParams Source #
Parameters specifying how the TCP server should be run
Constructors
| NetworkRunParams | |
Fields
| |
type TimeoutServer a = NetworkRunParams -> IO () -> Socket -> IO a Source #
mkTCPServerRunner :: NetworkRunParams -> Maybe HostName -> PortNumber -> TimeoutServer () -> IO (IO ()) Source #
Returns an IO action that will run a TCP server conforming to the run parameters. Will bind to localhost / loopback device only if no host name is specified. Will throw an exception when TCP server startup fails - the caller is responsible for appropriately reacting to that.