Instance Method (Default implementation)swift-nio 2.81.0NIOCore
bind(to:promise:)
Channel.swift:202func bind(to address: SocketAddress, promise: EventLoopPromise<Void>?)
func bind(to address: SocketAddress, promise: EventLoopPromise<Void>?)
s7NIOCore7ChannelPAAE4bind2to7promiseyAA13SocketAddressO_AA16EventLoopPromiseVyytGSgtF
What are these?8MLGV
import NIOCore
The core abstractions that make up SwiftNIO.
protocol Channel : AnyObject, ChannelOutboundInvoker, _NIOPreconcurrencySendable
A Channel
is easiest thought of as a network socket. But it can be anything that is capable of I/O operations such as read, write, connect, and bind.
enum SocketAddress
Represent a socket address to which we may want to connect or bind.
struct EventLoopPromise<Value>
A promise to provide a result later.
typealias Void = ()
The return type of functions that don’t explicitly specify a return type, that is, an empty tuple ()
.
func bind(to: SocketAddress, promise: EventLoopPromise<Void>?)
Bind to a SocketAddress
.
var syncOptions: NIOSynchronousChannelOptions? { get }
Default implementation: NIOSynchronousChannelOptions
are not supported.
func close(mode: CloseMode = .all, promise: EventLoopPromise<Void>?)
func connect(to address: SocketAddress, promise: EventLoopPromise<Void>?)
func flush()
func getOption<Option>(_ option: Option) async throws -> Option.Value where Option : ChannelOption
Get the value of option
for this Channel
.
func read()
func register(promise: EventLoopPromise<Void>?)
func registerAlreadyConfigured0(promise: EventLoopPromise<Void>?)
func setOption<Option>(_ option: Option, value: Option.Value) async throws where Option : ChannelOption
Set option
to value
on this Channel
.
@preconcurrency func triggerUserOutboundEvent(_ event: Sendable, promise: EventLoopPromise<Void>?)
@preconcurrency func write<T>(_ any: T) -> EventLoopFuture<Void> where T : Sendable
Write data into the Channel
.
func write<T>(_ data: T, promise: EventLoopPromise<Void>?) where T : Sendable
@preconcurrency func writeAndFlush<T>(_ any: T) -> EventLoopFuture<Void> where T : Sendable
Write and flush data into the Channel
.
@preconcurrency func writeAndFlush<T>(_ data: T) async throws where T : Sendable
Shortcut for calling write
and flush
.
func writeAndFlush<T>(_ data: T, promise: EventLoopPromise<Void>?) where T : Sendable
func write(_ data: NIOAny, promise: EventLoopPromise<Void>?)
func writeAndFlush(_ data: NIOAny, promise: EventLoopPromise<Void>?)