var allocator: ByteBufferAllocator
var allowRemoteHalfClosure: Bool
var closeFuture: EventLoopFuture<Void>
var embeddedEventLoop: EmbeddedEventLoop
Returns the EmbeddedEventLoop
that this EmbeddedChannel
uses. This will return the same instance as EmbeddedChannel.eventLoop
but as the concrete EmbeddedEventLoop
rather than as EventLoop
existential.
var eventLoop: EventLoop
var isActive: Bool
Returns true
if the EmbeddedChannel
is ‘active’.
var isWritable: Bool
var localAddress: SocketAddress?
let parent: Channel?
nil
because EmbeddedChannel
s don’t have parents.
var pipeline: ChannelPipeline
var remoteAddress: SocketAddress?
var syncOptions: NIOSynchronousChannelOptions?
func bind(to: SocketAddress, promise: EventLoopPromise<Void>?)
Fires the (outbound) bind
event through the ChannelPipeline
. If the event hits the EmbeddedChannel
which happens when it travels the ChannelPipeline
all the way to the front, this will also set the EmbeddedChannel
’s localAddress
.
func connect(to: SocketAddress, promise: EventLoopPromise<Void>?)
Fires the (outbound) connect
event through the ChannelPipeline
. If the event hits the EmbeddedChannel
which happens when it travels the ChannelPipeline
all the way to the front, this will also set the EmbeddedChannel
’s remoteAddress
.
func finish() throws -> LeftOverState
Synchronously closes the EmbeddedChannel
.
func finish(acceptAlreadyClosed: Bool) throws -> LeftOverState
Synchronously closes the EmbeddedChannel
.
func getOption<Option>(Option) -> EventLoopFuture<Option.Value>
func readOutbound<T>(as: T.Type) throws -> T?
If available, this method reads one element of type T
out of the EmbeddedChannel
’s outbound buffer. If the first element was of a different type than requested, EmbeddedChannel.WrongTypeError
will be thrown, if there are no elements in the outbound buffer, nil
will be returned.
func setOption<Option>(Option, value: Option.Value) -> EventLoopFuture<Void>
func throwIfErrorCaught() throws
This method will throw the error that is stored in the EmbeddedChannel
if any.
func write<T>(T) -> EventLoopFuture<Void>
An overload of Channel.write
that does not require a Sendable type, as EmbeddedEventLoop
is bound to a single thread.
func write<T>(T, promise: EventLoopPromise<Void>?)
An overload of Channel.write
that does not require a Sendable type, as EmbeddedEventLoop
is bound to a single thread.
func writeAndFlush<T>(T) -> EventLoopFuture<Void>
An overload of Channel.writeAndFlush
that does not require a Sendable type, as EmbeddedEventLoop
is bound to a single thread.
func writeAndFlush<T>(T, promise: EventLoopPromise<Void>?)
An overload of Channel.writeAndFlush
that does not require a Sendable type, as EmbeddedEventLoop
is bound to a single thread.
func writeInbound<T>(T) throws -> BufferState
Sends an inbound channelRead
event followed by a channelReadComplete
event through the ChannelPipeline
.
func writeOutbound<T>(T) throws -> BufferState
Sends an outbound writeAndFlush
event through the ChannelPipeline
.