bind(to:file:line:)
Bind to a SocketAddress
.
func bind(to address: SocketAddress, file: StaticString = #fileID, line: UInt = #line) -> EventLoopFuture<Void>
Parameters
Returns
the future which will be notified once the operation completes.
Bind to a SocketAddress
.
func bind(to address: SocketAddress, file: StaticString = #fileID, line: UInt = #line) -> EventLoopFuture<Void>
s7NIOCore22ChannelOutboundInvokerPAAE4bind2to4file4lineAA15EventLoopFutureCyytGAA13SocketAddressO_s12StaticStringVSutF
What are these?8DZUJ
the future which will be notified once the operation completes.
import NIOCore
The core abstractions that make up SwiftNIO.
protocol ChannelOutboundInvoker
Allows users to invoke an “outbound” operation related to a Channel
that will flow through the ChannelPipeline
until it will finally be executed by the the ChannelCore
implementation.
enum SocketAddress
Represent a socket address to which we may want to connect or bind.
@frozen struct StaticString
A string type designed to represent text that is known at compile time.
@frozen struct UInt
An unsigned integer value type.
final class EventLoopFuture<Value>
Holder for a result that will be provided later.
typealias Void = ()
The return type of functions that don’t explicitly specify a return type, that is, an empty tuple ()
.
func bind(to address: SocketAddress, file: StaticString = #fileID, line: UInt = #line) async throws
Bind to a SocketAddress
.
func close(mode: CloseMode = .all, file: StaticString = #fileID, line: UInt = #line) -> EventLoopFuture<Void>
Close the Channel
and so the connection if one exists.
func close(mode: CloseMode = .all, file: StaticString = #fileID, line: UInt = #line) async throws
Close the Channel
and so the connection if one exists.
func connect(to address: SocketAddress, file: StaticString = #fileID, line: UInt = #line) -> EventLoopFuture<Void>
Connect to a SocketAddress
.
func connect(to address: SocketAddress, file: StaticString = #fileID, line: UInt = #line) async throws
Connect to a SocketAddress
.
func register(file: StaticString = #fileID, line: UInt = #line) -> EventLoopFuture<Void>
Register on an EventLoop
and so have all its IO handled.
func register(file: StaticString = #fileID, line: UInt = #line) async throws
Register on an EventLoop
and so have all its IO handled.
@preconcurrency func triggerUserOutboundEvent(_ event: Sendable, file: StaticString = #fileID, line: UInt = #line) -> EventLoopFuture<Void>
Trigger a custom user outbound event which will flow through the ChannelPipeline
.
@preconcurrency func triggerUserOutboundEvent(_ event: Sendable, file: StaticString = #fileID, line: UInt = #line) async throws
Trigger a custom user outbound event which will flow through the ChannelPipeline
.
func write(_ data: NIOAny, file: StaticString = #fileID, line: UInt = #line) -> EventLoopFuture<Void>
Write data to the remote peer.
func writeAndFlush(_ data: NIOAny, file: StaticString = #fileID, line: UInt = #line) -> EventLoopFuture<Void>
Shortcut for calling write
and flush
.
func writeAndFlush(_ data: NIOAny, file: StaticString = #fileID, line: UInt = #line) async throws
Shortcut for calling write
and flush
.