channelOption(_:value:)
Bootstrap.swift:909func channelOption<Option>(_ option: Option, value: Option.Value) -> Self where Option : ChannelOption
func channelOption<Option>(_ option: Option, value: Option.Value) -> Self where Option : ChannelOption
s8NIOPosix15ClientBootstrapC13channelOption_5valueACXDx_5ValueQzt7NIOCore07ChannelE0RzlF
What are these?6N44V
import NIOPosix
final class ClientBootstrap
A ClientBootstrap
is an easy way to bootstrap a SocketChannel
when creating network clients.
associatedtype Value : Sendable
The type of the ChannelOption
’s value.
protocol ChannelOption : _NIOPreconcurrencySendable, Equatable
A configuration option that can be set on a Channel
to configure different behaviour.
convenience init(group: EventLoopGroup)
Create a ClientBootstrap
on the EventLoopGroup
group
.
init?(validatingGroup group: EventLoopGroup)
Create a ClientBootstrap
on the EventLoopGroup
group
, validating that group
is compatible.
func bind(to address: SocketAddress) -> ClientBootstrap
Bind the SocketChannel
to address
.
@preconcurrency func channelInitializer(_ handler: @escaping (Channel) -> EventLoopFuture<Void>) -> Self
func connect(host: String, port: Int) -> EventLoopFuture<Channel>
Specify the host
and port
to connect to for the TCP Channel
that will be established.
func connect<Output>(host: String, port: Int, channelInitializer: @escaping (Channel) -> EventLoopFuture<Output>) async throws -> Output where Output : Sendable
Specify the host
and port
to connect to for the TCP Channel
that will be established.
func connect(to address: VsockAddress) -> EventLoopFuture<Channel>
Specify the VSOCK address to connect to for the Channel
.
func connect(to address: SocketAddress) -> EventLoopFuture<Channel>
func connect<Output>(to address: SocketAddress, channelInitializer: @escaping (Channel) -> EventLoopFuture<Output>) async throws -> Output where Output : Sendable
Specify the address
to connect to for the TCP Channel
that will be established.
func connect<Output>(to address: VsockAddress, channelInitializer: @escaping (Channel) -> EventLoopFuture<Output>) async throws -> Output where Output : Sendable
Specify the VSOCK address to connect to for the Channel
.
func connect(unixDomainSocketPath: String) -> EventLoopFuture<Channel>
func connect<Output>(unixDomainSocketPath: String, channelInitializer: @escaping (Channel) -> EventLoopFuture<Output>) async throws -> Output where Output : Sendable
Specify the unixDomainSocket
path to connect to for the UDS Channel
that will be established.
func connectTimeout(_ timeout: TimeAmount) -> Self
Specifies a timeout to apply to a connection attempt.
func enableMPTCP(_ value: Bool) -> Self
Enables multi-path TCP support.
@preconcurrency func protocolHandlers(_ handlers: @escaping () -> [ChannelHandler]) -> Self
@preconcurrency func resolver(_ resolver: (Resolver & Sendable)?) -> Self
Specifies the Resolver
to use or nil
if the default should be used.
func withConnectedSocket(_ socket: NIOBSDSocket.Handle) -> EventLoopFuture<Channel>
Use the existing connected socket file descriptor.
func withConnectedSocket<Output>(_ socket: NIOBSDSocket.Handle, channelInitializer: @escaping (Channel) -> EventLoopFuture<Output>) async throws -> Output where Output : Sendable
Use the existing connected socket file descriptor.
func withConnectedSocket(descriptor: CInt) -> EventLoopFuture<Channel>
Use the existing connected socket file descriptor.