SwiftclassNetwork

class Network.NetworkChannel

Structure

What a query’s scopes step through. Every node here can be matched — see the syntax.

Members 76

  1. deinitdeinit
  2. fieldlet channelLock: os.OSAllocatedUnfairLock<Network.NetworkChannel<A>.NeworkChannelLockedState>
  3. fieldlet nw: Network.NWConnection?+0x10
  4. fieldlet nwGroup: Network.NWConnectionGroup?+0x18
  5. fieldlet readClosedNotifier: Network.ContinuationNotifier<()>
  6. fieldlet readyNotifier: Network.ContinuationNotifier<()>
  7. fieldlet writeClosedNotifier: Network.ContinuationNotifier<()>
  8. funccancel() -> ()
  9. funcNetwork.NetworkChannel< where A == Network.WebSocket>.close(code: Network.NWProtocolWebSocket.CloseCode, reason: String?, metadata: () -> [Network.NWProtocolMetadata]) async throws -> ()
  10. funcdataTransferReport() async throws -> Network.NWConnection.DataTransferReport
  11. funcNetwork.NetworkChannel< where A: Network.OneToOneProtocol>.endActivity(Network.NWActivity) -> ()
  12. funcNetwork.NetworkChannel< where A: Network.MultiplexProtocol>.endActivity(Network.NWActivity) -> ()
  13. funcestablishmentReport() async throws -> Network.NWConnection.EstablishmentReport
  14. funcmetadata(definition: Network.NWProtocolDefinition) -> Network.NWProtocolMetadata?
  15. funcNetwork.NetworkChannel< where A == Network.QUICStream>.onBetterPathUpdate(@isolated(any) @Sendable (Self, Bool) -> ()) -> Self
  16. funcNetwork.NetworkChannel< where A == Network.QUICStream>.onPathUpdate(@isolated(any) @Sendable (Self, Network.NWPath) -> ()) -> Self
  17. funcNetwork.NetworkChannel< where A == Network.QUICStream>.onViabilityUpdate(@isolated(any) @Sendable (Self, Bool) -> ()) -> Self
  18. funcNetwork.NetworkChannel< where A == Network.WebSocket>.ping<A where A1: Foundation.DataProtocol>(_: A1?, metadata: () -> [Network.NWProtocolMetadata]) async throws -> ()
  19. funcNetwork.NetworkChannel< where A == Network.WebSocket>.pong<A where A1: Foundation.DataProtocol>(_: A1?, metadata: () -> [Network.NWProtocolMetadata]) async throws -> ()
  20. funcreceive<A where A == Network.Framer<A1>, A1: Network.FramerProtocol>() async throws -> (content: Foundation.Data, metadata: Network.Framer<A1>.Metadata)
  21. funcreceive<A, B, C where A == Network.Coder<A1, B1, C1>, A1: Encodable, B1: Decodable, C1: Network.NetworkCoder>() async throws -> (content: B1, metadata: Network.Coder<A1, B1, C1>.Metadata)
  22. funcNetwork.NetworkChannel< where A == Network.QUICDatagram>.receive() async throws -> (content: Foundation.Data, metadata: Network.QUICDatagram.Metadata)
  23. funcNetwork.NetworkChannel< where A: Network.StreamProtocol>.receive<A where A1: Network.NetworkFixedWidthInteger>(as: A1.Type) async throws -> (content: A1, metadata: A.Metadata)
  24. funcNetwork.NetworkChannel< where A: Network.StreamProtocol>.receive(atLeast: Int, atMost: Int) async throws -> (content: Foundation.Data, metadata: A.Metadata)
  25. funcNetwork.NetworkChannel< where A: Network.StreamProtocol>.receive(exactly: Int) async throws -> (content: Foundation.Data, metadata: A.Metadata)
  26. funcNetwork.NetworkChannel< where A: Network.DatagramProtocol>.receive() async throws -> (content: Foundation.Data, metadata: A.Metadata)
  27. funcNetwork.NetworkChannel< where A == Network.TLV>.receive() async throws -> (content: Foundation.Data, metadata: Network.TLV.Metadata)
  28. funcNetwork.NetworkChannel< where A == Network.Datagram>.receive() async throws -> (content: Foundation.Data, metadata: Network.Datagram.Metadata)
  29. funcNetwork.NetworkChannel< where A == Network.WebSocket>.receive() async throws -> (content: Foundation.Data, metadata: Network.WebSocket.Metadata)
  30. funcreceiveWithMetadata<A, B, C where A == Network.Coder<A1, B1, C1>, A1: Encodable, B1: Decodable, C1: Network.NetworkCoder>() async throws -> (content: B1, metadata: Network.Coder<A1, B1, C1>.Metadata)
  31. funcNetwork.NetworkChannel< where A == Network.QUICDatagram>.receiveWithMetadata() async throws -> (content: Foundation.Data, metadata: Network.QUICDatagram.Metadata)
  32. funcNetwork.NetworkChannel< where A: Network.StreamProtocol>.receiveWithMetadata(atLeast: Int, atMost: Int) async throws -> (content: Foundation.Data, metadata: A.Metadata)
  33. funcNetwork.NetworkChannel< where A: Network.StreamProtocol>.receiveWithMetadata(exactly: Int) async throws -> (content: Foundation.Data, metadata: A.Metadata)
  34. funcNetwork.NetworkChannel< where A: Network.DatagramProtocol>.receiveWithMetadata() async throws -> (content: Foundation.Data, metadata: A.Metadata)
  35. funcNetwork.NetworkChannel< where A == Network.TLV>.receiveWithMetadata() async throws -> (content: Foundation.Data, metadata: Network.TLV.Metadata)
  36. funcNetwork.NetworkChannel< where A == Network.Datagram>.receiveWithMetadata() async throws -> (content: Foundation.Data, metadata: Network.Datagram.Metadata)
  37. funcNetwork.NetworkChannel< where A == Network.WebSocket>.receiveWithMetadata() async throws -> (content: Foundation.Data, metadata: Network.WebSocket.Metadata)
  38. funcsend<A where A == Network.Framer<A1>, A1: Network.FramerProtocol>(_: Foundation.Data, lastMessage: Bool, metadata: Network.NWProtocolFramer.Message?, other: () -> [Network.NWProtocolMetadata]) async throws -> ()
  39. funcsend<A, B, C where A == Network.Coder<A1, B1, C1>, A1: Encodable, B1: Decodable, C1: Network.NetworkCoder>(_: A1, metadata: () -> [Network.NWProtocolMetadata]) async throws -> ()
  40. funcNetwork.NetworkChannel< where A == Network.QUICDatagram>.send<A where A1: Foundation.DataProtocol>(_: A1, metadata: () -> [Network.NWProtocolMetadata]) async throws -> ()
  41. funcNetwork.NetworkChannel< where A: Network.StreamProtocol>.send<A where A1: Foundation.DataProtocol>(_: A1, endOfStream: Bool, metadata: () -> [Network.NWProtocolMetadata]) async throws -> ()
  42. funcNetwork.NetworkChannel< where A: Network.StreamProtocol>.send<A where A1: Network.NetworkFixedWidthInteger>(_: A1, endOfStream: Bool, metadata: () -> [Network.NWProtocolMetadata]) async throws -> ()
  43. funcNetwork.NetworkChannel< where A: Network.DatagramProtocol>.send<A where A1: Foundation.DataProtocol>(_: A1, metadata: () -> [Network.NWProtocolMetadata]) async throws -> ()
  44. funcNetwork.NetworkChannel< where A == Network.TLV>.send<A where A1: Foundation.DataProtocol>(_: A1, type: Int, lastMessage: Bool, metadata: () -> [Network.NWProtocolMetadata]) async throws -> ()
  45. funcNetwork.NetworkChannel< where A == Network.Datagram>.send<A where A1: Foundation.DataProtocol>(_: A1, metadata: () -> [Network.NWProtocolMetadata]) async throws -> ()
  46. funcNetwork.NetworkChannel< where A == Network.WebSocket>.send(_: String, metadata: () -> [Network.NWProtocolMetadata]) async throws -> ()
  47. funcNetwork.NetworkChannel< where A == Network.WebSocket>.send<A where A1: Foundation.DataProtocol>(_: A1, metadata: () -> [Network.NWProtocolMetadata]) async throws -> ()
  48. funcNetwork.NetworkChannel< where A: Network.StreamProtocol>.sendIdempotent<A where A1: Foundation.DataProtocol>(_: A1, endOfStream: Bool, metadata: () -> [Network.NWProtocolMetadata]) -> ()
  49. funcNetwork.NetworkChannel< where A: Network.StreamProtocol>.sendIdempotent<A where A1: Network.NetworkFixedWidthInteger>(_: A1, endOfStream: Bool, metadata: () -> [Network.NWProtocolMetadata]) -> ()
  50. funcNetwork.NetworkChannel< where A == Network.TLV>.sendIdempotent<A where A1: Foundation.DataProtocol>(_: A1, type: Int, lastMessage: Bool, metadata: () -> [Network.NWProtocolMetadata]) -> ()
  51. funcNetwork.NetworkChannel< where A == Network.WebSocket>.sendIdempotent(_: String, metadata: () -> [Network.NWProtocolMetadata]) -> ()
  52. funcNetwork.NetworkChannel< where A == Network.WebSocket>.sendIdempotent<A where A1: Foundation.DataProtocol>(_: A1, metadata: () -> [Network.NWProtocolMetadata]) -> ()
  53. funcstart(queue: OS_dispatch_queue) -> Self
  54. funcNetwork.NetworkChannel< where A: Network.OneToOneProtocol>.startActivity(Network.NWActivity) -> ()
  55. funcNetwork.NetworkChannel< where A: Network.MultiplexProtocol>.startActivity(Network.NWActivity) -> ()
  56. funcstartDataTransferReport() -> Network.NWConnection.PendingDataTransferReport
  57. funcstartIfNeeded(queue: OS_dispatch_queue) -> ()
  58. funcNetwork.NetworkChannel< where A == Network.WebSocket>.startReceive(((Int, Int) async throws -> (content: Foundation.Data, metadata: Network.WebSocket.Metadata)) async throws -> ()) async throws -> ()
  59. funcNetwork.NetworkChannel< where A == Network.WebSocket>.startSend(_: String, metadata: () -> [Network.NWProtocolMetadata], handler: ((String, Bool) async throws -> ()) async throws -> ()) async throws -> ()
  60. funcNetwork.NetworkChannel< where A == Network.WebSocket>.startSend<A where A1: Foundation.DataProtocol>(_: A1, metadata: () -> [Network.NWProtocolMetadata], handler: ((A1, Bool) async throws -> ()) async throws -> ()) async throws -> ()
  61. funcwaitForReadClosed() async throws -> ()
  62. funcwaitForWriteClosed() async throws -> ()
  63. typealiastypealias ApplicationProtocolType = A
  64. typealiastypealias ID = Swift.String
  65. varvar debugDescription: String { get }
  66. varvar id: String { get }
  67. varvar identifier: UInt64 { get }
  68. varvar maximumDatagramSize: Int { get }
  69. varvar messages: AsyncThrowingStream<(content: A.ContentType, metadata: A.Metadata), Error> { get }
  70. varvar messagesWithMetadata: AsyncThrowingStream<(content: A.ContentType, metadata: A.Metadata), Error> { get }
  71. varvar parameters: Network.NWParameters { get }
  72. varvar queue: OS_dispatch_queue? { get }
  73. varvar state: Network.NetworkChannel<A>.State { get }
  74. varvar streamApplicationErrorCode: UInt64 { get set }
  75. varvar streamID: UInt64 { get }
  76. varvar underlyingConnection: Network.NWConnection? { get }
class NetworkChannel<A> where A: Network.NetworkProtocolOptions {
    enum State {
        case waiting(Network.NWError)
        case failed(Network.NWError)
        case setup
        case preparing
        case ready
        case cancelled
    }
    struct NeworkChannelLockedState {
        var stateUpdateTask: Swift.Task<(), any Swift.Error>?
        var pathUpdateTask: Swift.Task<(), any Swift.Error>?
        var viabilityUpdateTask: Swift.Task<(), any Swift.Error>?
        var betterPathUpdateTask: Swift.Task<(), any Swift.Error>?
        var remoteEndpoint: Network.Endpoint?
        var parameters: Network.Parameters?
    }
    let nw: Network.NWConnection?
    let nwGroup: Network.NWConnectionGroup?
    let channelLock: os.OSAllocatedUnfairLock<Network.NetworkChannel<A>.NeworkChannelLockedState>
    let readyNotifier: Network.ContinuationNotifier<()>
    let readClosedNotifier: Network.ContinuationNotifier<()>
    let writeClosedNotifier: Network.ContinuationNotifier<()>

    var id: Swift.String {
        get
    }
    func start(queue: __C.OS_dispatch_queue) -> Self
    var debugDescription: Swift.String {
        get
    }
    var state: Network.NetworkChannel<A>.State {
        get
    }
    var maximumDatagramSize: Swift.Int {
        get
    }
    var parameters: Network.NWParameters {
        get
    }
    var identifier: Swift.UInt64 {
        get
    }
    var queue: __C.OS_dispatch_queue? {
        get
    }
    func cancel()
    func metadata(definition: Network.NWProtocolDefinition) -> Network.NWProtocolMetadata?
    var underlyingConnection: Network.NWConnection? {
        get
    }
    func establishmentReport() async throws -> Network.NWConnection.EstablishmentReport
    func dataTransferReport() async throws -> Network.NWConnection.DataTransferReport
    func startDataTransferReport() -> Network.NWConnection.PendingDataTransferReport
    func startIfNeeded(queue: __C.OS_dispatch_queue)
    func waitForReadClosed() async throws
    func waitForWriteClosed() async throws

    final func receiveWithMetadata<A1, B1, C1>() async throws -> (content: B1, metadata: Network.Coder<A1, B1, C1>.Metadata) where A == Network.Coder<A1, B1, C1>, A1: Swift.Encodable, B1: Swift.Decodable, C1: Network.NetworkCoder
    final func send<A1>(_: Foundation.Data, lastMessage: Swift.Bool, metadata: Network.NWProtocolFramer.Message?, other: () -> [Network.NWProtocolMetadata]) async throws where A == Network.Framer<A1>, A1: Network.FramerProtocol
    final func send<A1, B1, C1>(_: A1, metadata: () -> [Network.NWProtocolMetadata]) async throws where A == Network.Coder<A1, B1, C1>, A1: Swift.Encodable, B1: Swift.Decodable, C1: Network.NetworkCoder
    final func receive<A1>() async throws -> (content: Foundation.Data, metadata: Network.Framer<A1>.Metadata) where A == Network.Framer<A1>, A1: Network.FramerProtocol
    final func receive<A1, B1, C1>() async throws -> (content: B1, metadata: Network.Coder<A1, B1, C1>.Metadata) where A == Network.Coder<A1, B1, C1>, A1: Swift.Encodable, B1: Swift.Decodable, C1: Network.NetworkCoder

    deinit
}