Repository: vapor/vapor
File: Sources/Vapor/HTTP/Server/HTTPServer.swift (Swift)

Code before:
    public var localAddress: SocketAddress? {
        return self.connection.withLockedValue({ $0 })?.channel.localAddress
    }
    
    deinit {
        let started = self.didStart.withLockedValue { $0 }
        let shutdown = self.didShutdown.withLockedValue { $0 }
        assert(!started || shutdown, "HTTPServer did not shutdown before deinitializing")
    }
}

private final class HTTPServerConnection: Sendable {
    let channel: Channel
    let quiesce: ServerQuiescingHelper
    
    static func start(
        application: Application,
        server: HTTPServer,
        responder: Responder,
        configuration: HTTPServer.Configuration,
        on eventLoopGroup: EventLoopGroup
    ) -> EventLoopFuture<HTTPServerConnection> {
        let quiesce = ServerQuiescingHelper(group: eventLoopGroup)
        let bootstrap = ServerBootstrap(group: eventLoopGroup)
            /// Specify accepts per loop and backlog, and enable `SO_REUSEADDR` for the server itself.
            .serverChannelOption(ChannelOptions.maxMessagesPerRead, value: UInt(configuration.requestsPerServerTick))
            .serverChannelOption(ChannelOptions.backlog, value: Int32(configuration.backlog))
            .serverChannelOption(ChannelOptions.socket(SocketOptionLevel(SOL_SOCKET), SO_REUSEADDR), value: configuration.reuseAddress ? SocketOptionValue(1) : SocketOptionValue(0))
            
            /// Set handlers that are applied to the Server's channel.
            .serverChannelInitializer { channel in
                channel.pipeline.addHandler(quiesce.makeServerChannelHandler(channel: channel))
            }
            
            /// Set the handlers that are applied to the accepted Channels.
            .childChannelInitializer { [unowned application, unowned server] channel in
                /// Copy the most up-to-date configuration.
                let configuration = server.configuration

                /// Add TLS handlers if configured.
                if var tlsConfiguration = configuration.tlsConfiguration {
                    /// Prioritize http/2 if supported.
                    if configuration.supportVersions.contains(.two) {
                        tlsConfiguration.applicationProtocols.append("h2")
                    }
                    if configuration.supportVersions.contains(.one) {
                        tlsConfiguration.applicationProtocols.append("http/1.1")
                    }
                    let sslContext: NIOSSLContext
                    let tlsHandler: NIOSSLServerHandler
                    do {

Review comment (suggestion):
Is the conversion needed?!

```suggestion
            .serverChannelOption(ChannelOptions.maxMessagesPerRead, value: configuration.requestsPerServerTick)
```

Code after:
    public var localAddress: SocketAddress? {
        return self.connection.withLockedValue({ $0 })?.channel.localAddress
    }
    
    deinit {
        let started = self.didStart.withLockedValue { $0 }
        let shutdown = self.didShutdown.withLockedValue { $0 }
        assert(!started || shutdown, "HTTPServer did not shutdown before deinitializing")
    }
}

private final class HTTPServerConnection: Sendable {
    let channel: Channel
    let quiesce: ServerQuiescingHelper
    
    static func start(
        application: Application,
        server: HTTPServer,
        responder: Responder,
        configuration: HTTPServer.Configuration,
        on eventLoopGroup: EventLoopGroup
    ) -> EventLoopFuture<HTTPServerConnection> {
        let quiesce = ServerQuiescingHelper(group: eventLoopGroup)
        let bootstrap = ServerBootstrap(group: eventLoopGroup)
            /// Specify accepts per loop and backlog, and enable `SO_REUSEADDR` for the server itself.
            .serverChannelOption(ChannelOptions.maxMessagesPerRead, value: configuration.connectionsPerServerTick)
            .serverChannelOption(ChannelOptions.backlog, value: Int32(configuration.backlog))
            .serverChannelOption(ChannelOptions.socket(SocketOptionLevel(SOL_SOCKET), SO_REUSEADDR), value: configuration.reuseAddress ? SocketOptionValue(1) : SocketOptionValue(0))
            
            /// Set handlers that are applied to the Server's channel.
            .serverChannelInitializer { channel in
                channel.pipeline.addHandler(quiesce.makeServerChannelHandler(channel: channel))
            }
            
            /// Set the handlers that are applied to the accepted Channels.
            .childChannelInitializer { [unowned application, unowned server] channel in
                /// Copy the most up-to-date configuration.
                let configuration = server.configuration

                /// Add TLS handlers if configured.
                if var tlsConfiguration = configuration.tlsConfiguration {
                    /// Prioritize http/2 if supported.
                    if configuration.supportVersions.contains(.two) {
                        tlsConfiguration.applicationProtocols.append("h2")
                    }
                    if configuration.supportVersions.contains(.one) {
                        tlsConfiguration.applicationProtocols.append("http/1.1")
                    }
                    let sslContext: NIOSSLContext
                    let tlsHandler: NIOSSLServerHandler
                    do {