Instance Methodswift-nio 2.72.0NIOPosix
connect(unixDomainSocketPath:channelInitializer:)
Connect the DatagramChannel
to the unixDomainSocketPath
.
- iOS
- 13+
- macOS
- 10.15+
- tvOS
- 13+
- watchOS
- 6+
func connect<Output>(unixDomainSocketPath: String, channelInitializer: @escaping (Channel) -> EventLoopFuture<Output>) async throws -> Output where Output : Sendable
Parameters
- unixDomainSocketPath
The path of the UNIX Domain Socket to connect to.
path
must not exist, it will be created by the system.- channelInitializer
A closure to initialize the channel. The return value of this closure is returned from the
connect
method.
Returns
The result of the channel initializer.
Other members in extension
Type members
init(group: EventLoopGroup
) Create a
DatagramBootstrap
on theEventLoopGroup
group
.init?(validatingGroup: EventLoopGroup
) Create a
DatagramBootstrap
on theEventLoopGroup
group
, validating thatgroup
is compatible.
Instance members
func bind(host: String, port: Int
) -> EventLoopFuture<Channel> Bind the
DatagramChannel
tohost
andport
.func bind<Output>(host: String, port: Int, channelInitializer: @escaping (Channel) -> EventLoopFuture<Output>
) async throws -> Output Bind the
DatagramChannel
tohost
andport
.func bind(to: SocketAddress
) -> EventLoopFuture<Channel> Bind the
DatagramChannel
toaddress
.func bind<Output>(to: SocketAddress, channelInitializer: @escaping (Channel) -> EventLoopFuture<Output>
) async throws -> Output Bind the
DatagramChannel
to theaddress
.func bind(unixDomainSocketPath: String
) -> EventLoopFuture<Channel> Bind the
DatagramChannel
to a UNIX Domain Socket.func bind(unixDomainSocketPath: String, cleanupExistingSocketFile: Bool
) -> EventLoopFuture<Channel> Bind the
DatagramChannel
to a UNIX Domain Socket.func bind<Output>(unixDomainSocketPath: String, cleanupExistingSocketFile: Bool, channelInitializer: @escaping (Channel) -> EventLoopFuture<Output>
) async throws -> Output Bind the
DatagramChannel
to theunixDomainSocketPath
.func channelInitializer(@escaping (Channel) -> EventLoopFuture<Void>
) -> Self Initialize the bound
DatagramChannel
withinitializer
. The most common task in initializer is to addChannelHandler
s to theChannelPipeline
.func channelOption<Option>(Option, value: Option.Value
) -> Self Specifies a
ChannelOption
to be applied to theDatagramChannel
.func connect(host: String, port: Int
) -> EventLoopFuture<Channel> Connect the
DatagramChannel
tohost
andport
.func connect<Output>(host: String, port: Int, channelInitializer: @escaping (Channel) -> EventLoopFuture<Output>
) async throws -> Output Connect the
DatagramChannel
tohost
andport
.func connect(to: SocketAddress
) -> EventLoopFuture<Channel> Connect the
DatagramChannel
toaddress
.func connect<Output>(to: SocketAddress, channelInitializer: @escaping (Channel) -> EventLoopFuture<Output>
) async throws -> Output Connect the
DatagramChannel
to theaddress
.func connect(unixDomainSocketPath: String
) -> EventLoopFuture<Channel> Connect the
DatagramChannel
to a UNIX Domain Socket.func protocolSubtype(NIOBSDSocket.ProtocolSubtype
) -> Self func withBoundSocket(NIOBSDSocket.Handle
) -> EventLoopFuture<Channel> Use the existing bound socket file descriptor.
func withBoundSocket<Output>(NIOBSDSocket.Handle, channelInitializer: @escaping (Channel) -> EventLoopFuture<Output>
) async throws -> Output 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.