mutating func closeOutput()

in Sources/NIOTransportServices/NIOTSConnectionChannel.swift [850:863]


    mutating func closeOutput() throws {
        switch self {
        case .active(.open):
            self = .active(.halfClosedLocal)
        case .active(.halfClosedRemote):
            self = .active(.closed)
        case .active(.halfClosedLocal), .active(.closed):
            // This is a special case for closing the output, as it's user-controlled. If they already
            // closed it, we want to throw a special error to tell them.
            throw ChannelError.outputClosed
        case .idle, .registered, .activating, .inactive:
            throw NIOTSErrors.InvalidChannelStateTransition()
        }
    }