allowRemoteHalfClosure
AsyncTestingChannel.swift:175- iOS
- 13.0+
- macOS
- 10.15+
- tvOS
- 13.0+
- watchOS
- 6.0+
var allowRemoteHalfClosure: Bool { get set }see:
ChannelOptions.Types.AllowRemoteHalfClosureOption
var allowRemoteHalfClosure: Bool { get set }s11NIOEmbedded22NIOAsyncTestingChannelC22allowRemoteHalfClosureSbvp What are these?59VWBsee: ChannelOptions.Types.AllowRemoteHalfClosureOption
import NIOEmbeddedfinal class NIOAsyncTestingChannelA Channel with fine-grained control for testing.
@frozen struct BoolA value type whose instances are either true or false.
@preconcurrency convenience init(handler: any ChannelHandler & Sendable, loop: NIOAsyncTestingEventLoop = NIOAsyncTestingEventLoop()) async Create a new instance.
@preconcurrency convenience init(handlers: [any ChannelHandler & Sendable], loop: NIOAsyncTestingEventLoop = NIOAsyncTestingEventLoop()) async Create a new instance.
init(loop: NIOAsyncTestingEventLoop = NIOAsyncTestingEventLoop()) Create a new instance.
convenience init(loop: NIOAsyncTestingEventLoop = NIOAsyncTestingEventLoop(), channelInitializer: @escaping (NIOAsyncTestingChannel) throws -> Void) async throws Create a new instance.
var _channelCore: any ChannelCore { get }let allocator: ByteBufferAllocatorvar closeFuture: EventLoopFuture<Void> { get }var eventLoop: any EventLoop { get }var isActive: Bool { get }Returns true if the NIOAsyncTestingChannel is ‘active’.
var isWritable: Bool { get set }var localAddress: SocketAddress? { get set }var options: [(option: any ChannelOption, value: any Sendable)] { get }The ChannelOptions set on this channel.
let parent: (any Channel)?nil because NIOAsyncTestingChannels don’t have parents.
var pipeline: ChannelPipeline { get }var remoteAddress: SocketAddress? { get set }final var syncOptions: (any NIOSynchronousChannelOptions)? { get }let testingEventLoop: NIOAsyncTestingEventLoopReturns the NIOAsyncTestingEventLoop that this NIOAsyncTestingChannel uses. This will return the same instance as eventLoop but as the concrete NIOAsyncTestingEventLoop rather than as EventLoop existential.
func bind(to address: SocketAddress, promise: EventLoopPromise<Void>?) Fires the (outbound) bind event through the ChannelPipeline. If the event hits the NIOAsyncTestingChannel which happens when it travels the ChannelPipeline all the way to the front, this will also set the NIOAsyncTestingChannel’s localAddress.
func connect(to address: SocketAddress, promise: EventLoopPromise<Void>?) Fires the (outbound) connect event through the ChannelPipeline. If the event hits the NIOAsyncTestingChannel which happens when it travels the ChannelPipeline all the way to the front, this will also set the NIOAsyncTestingChannel’s remoteAddress.
func finish() async throws -> NIOAsyncTestingChannel.LeftOverState Asynchronously closes the NIOAsyncTestingChannel.
func finish(acceptAlreadyClosed: Bool) async throws -> NIOAsyncTestingChannel.LeftOverState Asynchronously closes the NIOAsyncTestingChannel.
func getOption<Option>(_ option: Option) -> EventLoopFuture<Option.Value> where Option : ChannelOption func readInbound<T>(as type: T.Type = T.self) async throws -> T? where T : Sendable If available, this method reads one element of type T out of the NIOAsyncTestingChannel’s inbound buffer. If the first element was of a different type than requested, WrongTypeError will be thrown, if there are no elements in the outbound buffer, nil will be returned.
func readOutbound<T>(as type: T.Type = T.self) async throws -> T? where T : Sendable If available, this method reads one element of type T out of the NIOAsyncTestingChannel’s outbound buffer. If the first element was of a different type than requested, WrongTypeError will be thrown, if there are no elements in the outbound buffer, nil will be returned.
func setOption<Option>(_ option: Option, value: Option.Value) -> EventLoopFuture<Void> where Option : ChannelOption func throwIfErrorCaught() async throws This method will throw the error that is stored in the NIOAsyncTestingChannel if any.
func waitForInboundWrite<T>(as type: T.Type = T.self) async throws -> T where T : Sendable This method is similar to readInbound(as:) but will wait if the inbound buffer is empty. If available, this method reads one element of type T out of the NIOAsyncTestingChannel’s inbound buffer. If the first element was of a different type than requested, WrongTypeError will be thrown. If the channel has already closed or closes before the next pending inbound write, ChannelError.ioOnClosedChannel will be thrown. If there are no elements in the inbound buffer, this method will wait until there is one, and return that element.
func waitForOutboundWrite<T>(as type: T.Type = T.self) async throws -> T where T : Sendable This method is similar to readOutbound(as:) but will wait if the outbound buffer is empty. If available, this method reads one element of type T out of the NIOAsyncTestingChannel’s outbound buffer. If the first element was of a different type than requested, WrongTypeError will be thrown. If the channel has already closed or closes before the next pending outbound write, ChannelError.ioOnClosedChannel will be thrown. If there are no elements in the outbound buffer, this method will wait until there is one, and return that element.
@discardableResult func writeInbound<T>(_ data: T) async throws -> NIOAsyncTestingChannel.BufferState where T : Sendable Sends an inbound channelRead event followed by a channelReadComplete event through the ChannelPipeline.
@discardableResult func writeOutbound<T>(_ data: T) async throws -> NIOAsyncTestingChannel.BufferState where T : Sendable Sends an outbound writeAndFlush event through the ChannelPipeline.
enum BufferStateBufferState represents the state of either the inbound, or the outbound NIOAsyncTestingChannel buffer.
enum LeftOverStateLeftOverState represents any left-over inbound, outbound, and pending outbound events that hit the NIOAsyncTestingChannel and were not consumed when finish was called on the NIOAsyncTestingChannel.
struct SynchronousOptionsstruct WrongTypeErrorWrongTypeError is thrown if you use readInbound(as:) or readOutbound(as:) and request a certain type but the first item in the respective buffer is of a different type.