MulticastChannel
A MulticastChannel
is a Channel
that supports IP multicast operations: that is, a channel that can join multicast groups.
protocol MulticastChannel : Channel
Browse conforming typesA MulticastChannel
is a Channel
that supports IP multicast operations: that is, a channel that can join multicast groups.
protocol MulticastChannel : Channel
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.
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.
protocol Sendable
@preconcurrency protocol _NIOPreconcurrencySendable : Sendable
func joinGroup(_ group: SocketAddress, device: NIONetworkDevice?, promise: EventLoopPromise<Void>?)
Request that the MulticastChannel
join the multicast group given by group
on the device given by device
.
func joinGroup(_ group: SocketAddress, promise: EventLoopPromise<Void>?)
Request that the MulticastChannel
join the multicast group given by group
.
func leaveGroup(_ group: SocketAddress, device: NIONetworkDevice?, promise: EventLoopPromise<Void>?)
Request that the MulticastChannel
leave the multicast group given by group
on the device given by device
.
func leaveGroup(_ group: SocketAddress, promise: EventLoopPromise<Void>?)
Request that the MulticastChannel
leave the multicast group given by group
.
func joinGroup(_ group: SocketAddress, interface: NIONetworkInterface?, promise: EventLoopPromise<Void>?)
Request that the MulticastChannel
join the multicast group given by group
on the interface given by interface
.
func leaveGroup(_ group: SocketAddress, interface: NIONetworkInterface?, promise: EventLoopPromise<Void>?)
Request that the MulticastChannel
leave the multicast group given by group
on the interface given by interface
.
protocol ChannelHandler : AnyObject
Base protocol for handlers that handle I/O events or intercept an I/O operation.
protocol ChannelOutboundHandler : _ChannelOutboundHandler, _EmittingChannelHandler
ChannelHandler
which handles outbound I/O events or intercept an outbound I/O operation for a Channel
.
protocol ChannelInboundHandler : _ChannelInboundHandler, _EmittingChannelHandler
ChannelHandler
which handles inbound I/O events for a Channel
.
typealias ChannelDuplexHandler = ChannelInboundHandler & ChannelOutboundHandler
A combination of ChannelInboundHandler
and ChannelOutboundHandler
.
final class ChannelHandlerContext
Every ChannelHandler
has – when added to a ChannelPipeline
– a corresponding ChannelHandlerContext
which is the way ChannelHandler
s can interact with other ChannelHandler
s in the pipeline.
final class ChannelPipeline
A list of ChannelHandler
s that handle or intercept inbound events and outbound operations of a Channel
. ChannelPipeline
implements an advanced form of the Intercepting Filter pattern to give a user full control over how an event is handled and how the ChannelHandler
s in a pipeline interact with each other.
protocol RemovableChannelHandler : ChannelHandler
A RemovableChannelHandler
is a ChannelHandler
that can be dynamically removed from a ChannelPipeline
whilst the Channel
is operating normally. A RemovableChannelHandler
is required to remove itself from the ChannelPipeline
(using ChannelHandlerContext.leavePipeline
) as soon as possible.
struct NIOAny
NIOAny
is an opaque container for values of any type, similar to Swift’s builtin Any
type. Contrary to Any
the overhead of NIOAny
depends on the the type of the wrapped value. Certain types that are important for the performance of a SwiftNIO application like ByteBuffer
, FileRegion
and AddressEnvelope<ByteBuffer>
can be expected to be wrapped almost without overhead. All others will have similar performance as if they were passed as an Any
as NIOAny
just like Any
will contain them within an existential container.
enum ChannelEvent
An Channel
related event that is passed through the ChannelPipeline
to notify the user.
enum CloseMode
Specify what kind of close operation is requested.
struct ChannelShouldQuiesceEvent
A Channel
user event that is sent when the Channel
has been asked to quiesce.
func joinGroup(_ group: SocketAddress) -> EventLoopFuture<Void>
func joinGroup(_ group: SocketAddress, device: NIONetworkDevice?) -> EventLoopFuture<Void>
func joinGroup(_ group: SocketAddress, device: NIONetworkDevice?, promise: EventLoopPromise<Void>?)
Request that the MulticastChannel
join the multicast group given by group
on the device given by device
.
func joinGroup(_ group: SocketAddress, promise: EventLoopPromise<Void>?)
func leaveGroup(_ group: SocketAddress) -> EventLoopFuture<Void>
func leaveGroup(_ group: SocketAddress, device: NIONetworkDevice?) -> EventLoopFuture<Void>
func leaveGroup(_ group: SocketAddress, device: NIONetworkDevice?, promise: EventLoopPromise<Void>?)
Request that the MulticastChannel
leave the multicast group given by group
on the device given by device
.
func leaveGroup(_ group: SocketAddress, promise: EventLoopPromise<Void>?)
func joinGroup(_ group: SocketAddress, interface: NIONetworkInterface?) -> EventLoopFuture<Void>
func leaveGroup(_ group: SocketAddress, interface: NIONetworkInterface?) -> EventLoopFuture<Void>