Configuration
public struct Configuration
Application configuration
-
Bind address for server
Declaration
Swift
public let address: HBBindAddress
-
Server name to return in “server” header
Declaration
Swift
public let serverName: String?
-
Maximum upload size allowed
Declaration
Swift
public let maxUploadSize: Int
-
Maximum size of buffer for streaming request payloads
Declaration
Swift
public let maxStreamingBufferSize: Int
-
Defines the maximum length for the queue of pending connections
Declaration
Swift
public let backlog: Int
-
Allows socket to be bound to an address that is already in use.
Declaration
Swift
public let reuseAddress: Bool
-
Disables the Nagle algorithm for send coalescing.
Declaration
Swift
public let tcpNoDelay: Bool
-
Pipelining ensures that only one http request is processed at one time
Declaration
Swift
public let enableHttpPipelining: Bool
-
TLS options for NIO Transport services
Declaration
Swift
public let tlsOptions: TSTLSOptions
-
Number of threads to allocate in the application thread pool
Declaration
Swift
public let threadPoolSize: Int
-
don’t run the HTTP server
Declaration
Swift
public let noHTTPServer: Bool
-
logging level
Declaration
Swift
public let logLevel: Logger.Level
-
init(address:serverName:maxUploadSize:maxStreamingBufferSize:backlog:reuseAddress:tcpNoDelay:enableHttpPipelining:threadPoolSize:logLevel:noHTTPServer:)
Create configuration struct
Declaration
Swift
public init( address: HBBindAddress = .hostname(), serverName: String? = nil, maxUploadSize: Int = 2 * 1024 * 1024, maxStreamingBufferSize: Int = 1 * 1024 * 1024, backlog: Int = 256, reuseAddress: Bool = true, tcpNoDelay: Bool = false, enableHttpPipelining: Bool = true, threadPoolSize: Int = 2, logLevel: Logger.Level? = nil, noHTTPServer: Bool = false )
-
init(address:serverName:maxUploadSize:maxStreamingBufferSize:backlog:reuseAddress:tcpNoDelay:enableHttpPipelining:threadPoolSize:logLevel:noHTTPServer:tlsOptions:)
Create configuration struct
Declaration
Swift
@available(macOS 10.14, iOS 12, tvOS 12, *) public init( address: HBBindAddress = .hostname(), serverName: String? = nil, maxUploadSize: Int = 2 * 1024 * 1024, maxStreamingBufferSize: Int = 1 * 1024 * 1024, backlog: Int = 256, reuseAddress: Bool = true, tcpNoDelay: Bool = false, enableHttpPipelining: Bool = true, threadPoolSize: Int = 2, logLevel: Logger.Level? = nil, noHTTPServer: Bool = false, tlsOptions: TSTLSOptions )
-
with(address:serverName:maxUploadSize:maxStreamingBufferSize:backlog:reuseAddress:tcpNoDelay:enableHttpPipelining:threadPoolSize:logLevel:)
Create new configuration struct with updated values
Declaration
Swift
public func with( address: HBBindAddress? = nil, serverName: String? = nil, maxUploadSize: Int? = nil, maxStreamingBufferSize: Int? = nil, backlog: Int? = nil, reuseAddress: Bool? = nil, tcpNoDelay: Bool? = nil, enableHttpPipelining: Bool? = nil, threadPoolSize: Int? = nil, logLevel: Logger.Level? = nil ) -> Self