Instance Methodswift-nio 2.72.0NIOPosix
connectTimeout(_:)
Specifies a timeout to apply to a connection attempt.
Bootstrap.swift:901func connectTimeout(_ timeout: TimeAmount) -> Self
Parameters
- timeout
The timeout that will apply to the connection attempt.
Other members in extension
Type members
init(group: EventLoopGroup
) Create a
ClientBootstrap
on theEventLoopGroup
group
.init?(validatingGroup: EventLoopGroup
) Create a
ClientBootstrap
on theEventLoopGroup
group
, validating thatgroup
is compatible.
Instance members
func bind(to: SocketAddress
) -> ClientBootstrap Bind the
SocketChannel
toaddress
.func channelInitializer(@escaping (Channel) -> EventLoopFuture<Void>
) -> Self func channelOption<Option>(Option, value: Option.Value
) -> Self func connect(host: String, port: Int
) -> EventLoopFuture<Channel> func connect<Output>(host: String, port: Int, channelInitializer: @escaping (Channel) -> EventLoopFuture<Output>
) async throws -> Output Specify the
host
andport
to connect to for the TCPChannel
that will be established.func connect(to: VsockAddress
) -> EventLoopFuture<Channel> Specify the VSOCK address to connect to for the
Channel
.func connect(to: SocketAddress
) -> EventLoopFuture<Channel> func connect<Output>(to: SocketAddress, channelInitializer: @escaping (Channel) -> EventLoopFuture<Output>
) async throws -> Output Specify the
address
to connect to for the TCPChannel
that will be established.func connect<Output>(to: VsockAddress, channelInitializer: @escaping (Channel) -> EventLoopFuture<Output>
) async throws -> Output 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 Specify the
unixDomainSocket
path to connect to for the UDSChannel
that will be established.func enableMPTCP(Bool
) -> Self Enables multi-path TCP support.
func protocolHandlers(@escaping () -> [ChannelHandler]
) -> Self func resolver(Resolver?
) -> Self Specifies the
Resolver
to use ornil
if the default should be used.func withConnectedSocket(NIOBSDSocket.Handle
) -> EventLoopFuture<Channel> Use the existing connected socket file descriptor.
func withConnectedSocket<Output>(NIOBSDSocket.Handle, channelInitializer: @escaping (Channel) -> EventLoopFuture<Output>
) async throws -> Output Use the existing connected socket file descriptor.
Show obsolete interfaces (1)
Hide obsolete interfaces
func withConnectedSocket(descriptor: CInt
) -> EventLoopFuture<Channel> Use the existing connected socket file descriptor.