Initializerswift-nio 2.72.0NIOPosix
init(validatingGroup:childGroup:)
Create a ServerBootstrap
on the EventLoopGroup
group
which accepts Channel
s on childGroup
, validating that the EventLoopGroup
s are compatible with ServerBootstrap
.
init?(validatingGroup group: EventLoopGroup, childGroup: EventLoopGroup? = nil)
Parameters
- group
The
EventLoopGroup
to use for thebind
of theServerSocketChannel
and to accept newSocketChannel
s with.- childGroup
The
EventLoopGroup
to run the acceptedSocketChannel
s on. Ifnil
,group
is used.
Other members in extension
Type members
init(group: EventLoopGroup
) Create a
ServerBootstrap
on theEventLoopGroup
group
.init(group: EventLoopGroup, childGroup: EventLoopGroup
) Create a
ServerBootstrap
on theEventLoopGroup
group
which acceptsChannel
s onchildGroup
.
Instance members
func bind<Output>(NIOBSDSocket.Handle, cleanupExistingSocketFile: Bool, serverBackPressureStrategy: NIOAsyncSequenceProducerBackPressureStrategies.HighLowWatermark?, childChannelInitializer: @escaping (Channel) -> EventLoopFuture<Output>
) async throws -> NIOAsyncChannel<Output, Never> Use the existing bound socket file descriptor.
func bind(host: String, port: Int
) -> EventLoopFuture<Channel> Bind the
ServerSocketChannel
tohost
andport
.func bind<Output>(host: String, port: Int, serverBackPressureStrategy: NIOAsyncSequenceProducerBackPressureStrategies.HighLowWatermark?, childChannelInitializer: @escaping (Channel) -> EventLoopFuture<Output>
) async throws -> NIOAsyncChannel<Output, Never> Bind the
ServerSocketChannel
to thehost
andport
parameters.func bind(to: VsockAddress
) -> EventLoopFuture<Channel> Bind the
ServerSocketChannel
to a VSOCK socket.func bind(to: SocketAddress
) -> EventLoopFuture<Channel> Bind the
ServerSocketChannel
toaddress
.func bind<Output>(to: VsockAddress, serverBackPressureStrategy: NIOAsyncSequenceProducerBackPressureStrategies.HighLowWatermark?, childChannelInitializer: @escaping (Channel) -> EventLoopFuture<Output>
) async throws -> NIOAsyncChannel<Output, Never> Bind the
ServerSocketChannel
to a VSOCK socket.func bind<Output>(to: SocketAddress, serverBackPressureStrategy: NIOAsyncSequenceProducerBackPressureStrategies.HighLowWatermark?, childChannelInitializer: @escaping (Channel) -> EventLoopFuture<Output>
) async throws -> NIOAsyncChannel<Output, Never> Bind the
ServerSocketChannel
to theaddress
parameter.func bind(unixDomainSocketPath: String
) -> EventLoopFuture<Channel> Bind the
ServerSocketChannel
to a UNIX Domain Socket.func bind(unixDomainSocketPath: String, cleanupExistingSocketFile: Bool
) -> EventLoopFuture<Channel> Bind the
ServerSocketChannel
to a UNIX Domain Socket.func bind<Output>(unixDomainSocketPath: String, cleanupExistingSocketFile: Bool, serverBackPressureStrategy: NIOAsyncSequenceProducerBackPressureStrategies.HighLowWatermark?, childChannelInitializer: @escaping (Channel) -> EventLoopFuture<Output>
) async throws -> NIOAsyncChannel<Output, Never> Bind the
ServerSocketChannel
to a UNIX Domain Socket.func bindTimeout(TimeAmount
) -> Self Specifies a timeout to apply to a bind attempt. Currently unsupported.
func childChannelInitializer(@escaping (Channel) -> EventLoopFuture<Void>
) -> Self Initialize the accepted
SocketChannel
s withinitializer
. The most common task in initializer is to addChannelHandler
s to theChannelPipeline
. Note that if theinitializer
fails then the error will be fired in the parent channel.func childChannelOption<Option>(Option, value: Option.Value
) -> Self Specifies a
ChannelOption
to be applied to the acceptedSocketChannel
s.func enableMPTCP(Bool
) -> Self Enables multi-path TCP support.
func serverChannelInitializer(@escaping (Channel) -> EventLoopFuture<Void>
) -> Self Initialize the
ServerSocketChannel
withinitializer
. The most common task in initializer is to addChannelHandler
s to theChannelPipeline
.func serverChannelOption<Option>(Option, value: Option.Value
) -> Self Specifies a
ChannelOption
to be applied to theServerSocketChannel
.func withBoundSocket(NIOBSDSocket.Handle
) -> EventLoopFuture<Channel> Use the existing bound socket file descriptor.
Show obsolete interfaces (1)
Hide obsolete interfaces
func withBoundSocket(descriptor: CInt
) -> EventLoopFuture<Channel> Use the existing bound socket file descriptor.