API Differences in Network in macOS 26.0

It's more difficult than it used to be to find what changed in Apple SDKs. This page is automatically generated and shows what is new in Network in the macOS 26.0 SDK.

Table of Contents

Protocols

BrowserProvider
Connectable
ConnectionStorage
DatagramProtocol
FramerProtocol
ListenerProvider
MessageProtocol
MultiplexProtocol
NWParametersProvider
NetworkCoder
NetworkDecoder
NetworkEncoder
NetworkFixedWidthInteger
NetworkMetadataProtocol
NetworkProtocolOptions
OneToOneProtocol
StreamProtocol

Classes

NetworkBrowser
NetworkChannel
NetworkConnection
NetworkListener
QUIC
Datagrams
QUIC
Stream

Structs

Bonjour
BonjourListenerProvider
Coder
DefaultProtocolStorage
Framer
IP
NWParametersBuilder
NetworkJSONCoder
NetworkPropertyListCoder
ProtocolMetadataBuilder
ProtocolStackBuilder
QUIC
QUICDatagram
QUICStream
TCP
TLS
TLV
UDP
UnexpectedEndpointType
WebSocket

Enums

NWPath
LinkQuality

Functions & Methods

BrowserProvider
public static func bonjour(_ type: Swift.String, domain: Swift.String? = nil, includeTxtRecord: Swift.Bool = false) -> Network.Bonjour
ListenerProvider
public static func bonjour(name: Swift.String? = nil, type: Swift.String, domain: Swift.String? = nil, txtRecord: Network.NWTXTRecord? = nil) -> Network.BonjourListenerProvider
NWParametersProvider
public func constrainedPathsProhibited(_ prohibited: Swift.Bool) -> Self
NWParametersProvider
public func dnssecValidationRequired(_ required: Swift.Bool) -> Self
NWParametersProvider
public func expensivePathsProhibited(_ prohibited: Swift.Bool) -> Self
NWParametersProvider
public func expiredDNSBehavior(_ behavior: Network.NWParameters.ExpiredDNSBehavior) -> Self
NWParametersProvider
public func fastOpenAllowed(_ allowed: Swift.Bool) -> Self
NWParametersProvider
public func localEndpoint(_ endpoint: Network.NWEndpoint?) -> Self
NWParametersProvider
public func localEndpointReuseAllowed(_ allowed: Swift.Bool) -> Self
NWParametersProvider
public func localOnly(_ local: Swift.Bool) -> Self
NWParametersProvider
public func localPort(_ port: Network.NWEndpoint.Port) -> Self
NWParametersProvider
public func multipathServiceType(_ type: Network.NWParameters.MultipathServiceType) -> Self
NWParametersProvider
public func noProxiesPreferred(_ noProxies: Swift.Bool) -> Self
NWParametersProvider
public func peerToPeerIncluded(_ included: Swift.Bool) -> Self
NWParametersProvider
public func prohibitedInterfaceTypes(_ types: [Network.NWInterface.InterfaceType]) -> Self
NWParametersProvider
public func prohibitedInterfaces(_ interfaces: [Network.NWInterface]) -> Self
NWParametersProvider
public func requiredInterface(_ interface: Network.NWInterface) -> Self
NWParametersProvider
public func requiredInterfaceType(_ type: Network.NWInterface.InterfaceType) -> Self
NWParametersProvider
public func serviceClass(_ serviceClass: Network.NWParameters.ServiceClass) -> Self
NWParametersProvider
public func ultraConstrainedPathsAllowed(_ val: Swift.Bool) -> Self
NWProtocolIP.Metadata
public func ecn(_ ecn: Network.NWProtocolIP.ECN) -> Self
NWProtocolIP.Metadata
public func serviceClass(_ serviceClass: Network.NWParameters.ServiceClass) -> Self
NetworkChannel
public func close(code: Network.NWProtocolWebSocket.CloseCode = .protocolCode(.normalClosure), reason: Swift.String? = nil, @Network.ProtocolMetadataBuilder metadata builder: () -> [Network.NWProtocolMetadata] = {[]}) async throws
NetworkChannel
public func ping<Content>(_ content: Content? = nil, @Network.ProtocolMetadataBuilder metadata builder: () -> [Network.NWProtocolMetadata] = {[]}) async throws where Content : Foundation.DataProtocol
NetworkChannel
public func pong<Content>(_ content: Content? = nil, @Network.ProtocolMetadataBuilder metadata builder: () -> [Network.NWProtocolMetadata] = {[]}) async throws where Content : Foundation.DataProtocol
NetworkChannel
public func receive(atLeast: Swift.Int = 1, atMost: Swift.Int) async throws -> ApplicationProtocol.Message<Foundation.Data>
NetworkChannel
public func receive(exactly: Swift.Int) async throws -> ApplicationProtocol.Message<Foundation.Data>
NetworkChannel
public func receive<Value>(as type: Value.Type) async throws -> ApplicationProtocol.Message<Value> where Value : Network.NetworkFixedWidthInteger
NetworkChannel
public func receive() async throws -> ApplicationProtocol.Message<Foundation.Data>
NetworkChannel
public func receive() async throws -> ApplicationProtocol.Message<Foundation.Data>
NetworkChannel
public func receive() async throws -> ApplicationProtocol.Message<Foundation.Data>
NetworkChannel
public func receive<Sending, Receiving, CoderType>() async throws -> ApplicationProtocol.Message<Receiving> where ApplicationProtocol == Network.Coder<Sending, Receiving, CoderType>, Sending : Swift.Encodable, Receiving : Swift.Decodable, CoderType : Network.NetworkCoder
NetworkChannel
public func receive<T>() async throws -> ApplicationProtocol.Message<Foundation.Data> where ApplicationProtocol == Network.Framer<T>, T : Network.FramerProtocol
NetworkChannel
public func send<Content>(_ content: Content, endOfStream: Swift.Bool = false, @Network.ProtocolMetadataBuilder metadata builder: () -> [Network.NWProtocolMetadata] = {[]}) async throws where Content : Foundation.DataProtocol
NetworkChannel
public func send<Value>(_ value: Value, endOfStream: Swift.Bool = false, @Network.ProtocolMetadataBuilder metadata builder: () -> [Network.NWProtocolMetadata] = {[]}) async throws where Value : Network.NetworkFixedWidthInteger
NetworkChannel
public func send<Content>(_ content: Content, @Network.ProtocolMetadataBuilder metadata builder: () -> [Network.NWProtocolMetadata] = {[]}) async throws where Content : Foundation.DataProtocol
NetworkChannel
public func send(_ content: Swift.String, @Network.ProtocolMetadataBuilder metadata builder: () -> [Network.NWProtocolMetadata] = {[]}) async throws
NetworkChannel
public func send<Content>(_ content: Content, @Network.ProtocolMetadataBuilder metadata builder: () -> [Network.NWProtocolMetadata] = {[]}) async throws where Content : Foundation.DataProtocol
NetworkChannel
public func send<Content>(_ content: Content, type: Swift.Int, lastMessage: Swift.Bool = false, @Network.ProtocolMetadataBuilder metadata builder: () -> [Network.NWProtocolMetadata] = {[]}) async throws where Content : Foundation.DataProtocol
NetworkChannel
public func send<Sending, Receiving, CoderType>(_ content: Sending, @Network.ProtocolMetadataBuilder metadata builder: () -> [Network.NWProtocolMetadata] = {[]}) async throws where ApplicationProtocol == Network.Coder<Sending, Receiving, CoderType>, Sending : Swift.Encodable, Receiving : Swift.Decodable, CoderType : Network.NetworkCoder
NetworkChannel
public func send<T>(_ content: Foundation.Data, lastMessage: Swift.Bool = false, metadata: Network.NWProtocolFramer.Message? = nil, @Network.ProtocolMetadataBuilder other builder: () -> [Network.NWProtocolMetadata] = {[]}) async throws where ApplicationProtocol == Network.Framer<T>, T : Network.FramerProtocol
NetworkChannel
public func sendIdempotent<Content>(_ content: Content, endOfStream: Swift.Bool = false, @Network.ProtocolMetadataBuilder metadata builder: () -> [Network.NWProtocolMetadata] = {[]}) where Content : Foundation.DataProtocol
NetworkChannel
public func sendIdempotent<Value>(_ value: Value, endOfStream: Swift.Bool = false, @Network.ProtocolMetadataBuilder metadata builder: () -> [Network.NWProtocolMetadata] = {[]}) where Value : Network.NetworkFixedWidthInteger
NetworkChannel
public func sendIdempotent(_ content: Swift.String, @Network.ProtocolMetadataBuilder metadata builder: () -> [Network.NWProtocolMetadata] = {[]})
NetworkChannel
public func sendIdempotent<Content>(_ content: Content, @Network.ProtocolMetadataBuilder metadata builder: () -> [Network.NWProtocolMetadata] = {[]}) where Content : Foundation.DataProtocol
NetworkChannel
public func sendIdempotent<Content>(_ content: Content, type: Swift.Int, lastMessage: Swift.Bool = false, @Network.ProtocolMetadataBuilder metadata builder: () -> [Network.NWProtocolMetadata] = {[]}) where Content : Foundation.DataProtocol
NetworkChannel
public func startReceive(_ handler: (_ receive: (_ atLeast: Swift.Int, _ atMost: Swift.Int) async throws -> ApplicationProtocol.Message<Foundation.Data>) async throws -> Swift.Void) async throws
NetworkChannel
public func startSend(_ content: Swift.String, @Network.ProtocolMetadataBuilder metadata builder: () -> [Network.NWProtocolMetadata] = {[]}, handler: (_ send: (_ content: Swift.String, _ isComplete: Swift.Bool) async throws -> Swift.Void) async throws -> Swift.Void) async throws
NetworkChannel
public func startSend<Content>(_ content: Content, @Network.ProtocolMetadataBuilder metadata builder: () -> [Network.NWProtocolMetadata] = {[]}, handler: (_ send: (_ content: Content, _ isComplete: Swift.Bool) async throws -> Swift.Void) async throws -> Swift.Void) async throws where Content : Foundation.DataProtocol
NetworkConnection
final public func inboundStreams(@_inheritActorContext _ handler: @escaping @isolated(any) @Sendable (Network.QUIC.Stream<Network.QUICStream>) async throws -> Swift.Void) async throws
NetworkConnection
final public func inboundStreams<NewApplicationProtocol>(@Network.ProtocolStackBuilder<NewApplicationProtocol> prepending: @escaping (Network.QUICStream) -> NewApplicationProtocol, @_inheritActorContext _ handler: @escaping @isolated(any) @Sendable (Network.QUIC.Stream<NewApplicationProtocol>) async throws -> Swift.Void) async throws where NewApplicationProtocol : Network.OneToOneProtocol
NetworkConnection
@discardableResult final public func onBetterPathUpdate(@_inheritActorContext _ handler: @escaping @isolated(any) @Sendable (_ connection: Network.NetworkConnection<ApplicationProtocol>, _ newValue: Swift.Bool) -> Swift.Void) -> Self
NetworkConnection
@discardableResult final public func onPathUpdate(@_inheritActorContext _ handler: @escaping @isolated(any) @Sendable (_ connection: Network.NetworkConnection<ApplicationProtocol>, _ newPath: Network.NWPath) -> Swift.Void) -> Self
NetworkConnection
@discardableResult final public func onViabilityUpdate(@_inheritActorContext _ handler: @escaping @isolated(any) @Sendable (_ connection: Network.NetworkConnection<ApplicationProtocol>, _ newViable: Swift.Bool) -> Swift.Void) -> Self
NetworkConnection
final public func openStream(directionality: Network.QUICStream.Directionality = .bidirectional) async throws -> Network.QUIC.Stream<Network.QUICStream>
NetworkConnection
final public func openStream<NewApplicationProtocol>(directionality: Network.QUICStream.Directionality = .bidirectional, @Network.ProtocolStackBuilder<NewApplicationProtocol> _ prepending: (Network.QUICStream) -> NewApplicationProtocol) async throws -> Network.QUIC.Stream<NewApplicationProtocol> where NewApplicationProtocol : Network.OneToOneProtocol
NetworkConnection
final public func start() -> Self
NetworkListener
final public func run(@_inheritActorContext _ handler: @escaping @isolated(any) @Sendable (Network.NetworkConnection<ApplicationProtocol>) async throws -> Swift.Void) async throws
NetworkListener
final public func run(@_inheritActorContext _ handler: @escaping @isolated(any) @Sendable (Network.NetworkConnection<ApplicationProtocol>) async throws -> Swift.Void) async throws
nonisolated(nonsending) public func withNetworkConnection<ApplicationProtocol>(to endpoint: Network.NWEndpoint, @Network.ProtocolStackBuilder<ApplicationProtocol> using builder: () -> ApplicationProtocol, _ handler: (Network.NetworkConnection<ApplicationProtocol>) async throws -> Swift.Void) async throws where ApplicationProtocol : Network.OneToOneProtocol
nonisolated(nonsending) public func withNetworkConnection<ApplicationProtocol>(to endpoint: Network.NWEndpoint, using builder: Network.NWParametersBuilder<ApplicationProtocol>, _ handler: (Network.NetworkConnection<ApplicationProtocol>) async throws -> Swift.Void) async throws where ApplicationProtocol : Network.OneToOneProtocol
nonisolated(nonsending) public func withNetworkConnection<ApplicationProtocol>(to endpoint: Network.NWEndpoint, @Network.ProtocolStackBuilder<ApplicationProtocol> using builder: () -> ApplicationProtocol, _ handler: (Network.NetworkConnection<ApplicationProtocol>) async throws -> Swift.Void) async throws where ApplicationProtocol : Network.MultiplexProtocol
nonisolated(nonsending) public func withNetworkConnection<ApplicationProtocol>(to endpoint: Network.NWEndpoint, using builder: Network.NWParametersBuilder<ApplicationProtocol>, _ handler: (Network.NetworkConnection<ApplicationProtocol>) async throws -> Swift.Void) async throws where ApplicationProtocol : Network.MultiplexProtocol
bool nw_path_is_ultra_constrained(nw_path_t _Nonnull path)
nw_link_quality_t nw_path_get_link_quality(nw_path_t _Nonnull path)
void nw_parameters_set_allow_ultra_constrained(nw_parameters_t _Nonnull parameters, bool allow_ultra_constrained)
bool nw_parameters_get_allow_ultra_constrained(nw_parameters_t _Nonnull parameters)

Properties & Constants

NWParameters
final public var allowUltraConstrainedPaths: Swift.Bool
NWParameters
final public var parameters: Network.NWParameters
NWPath
public var isUltraConstrained: Swift.Bool
NWPath
public var linkQuality: Network.NWPath.LinkQuality
NetworkChannel
public var messages: _Concurrency.AsyncThrowingStream<ApplicationProtocol.Message<ApplicationProtocol.ContentType>, any Swift.Error>
NetworkCoder
public static var json: Network.NetworkJSONCoder
NetworkCoder
public static var propertyList: Network.NetworkPropertyListCoder
NetworkConnection
final public var applicationError: Network.NWProtocolQUIC.ApplicationError
NetworkConnection
final public var datagrams: Network.QUIC.Datagrams<Network.QUICDatagram>
NetworkConnection
final public var keepalive: Network.NWProtocolQUIC.Metadata.KeepAliveBehavior
NetworkConnection
final public var negotiatedALPN: Swift.String?
NetworkConnection
final public var remoteIdleTimeout: Swift.Int
NetworkConnection
final public var remoteMaxStreamsBidirectional: Swift.Int
NetworkConnection
final public var remoteMaxStreamsUnidirectional: Swift.Int
NetworkConnection
final public var securityProtocolMetadata: Security.sec_protocol_metadata_t
NetworkConnection
final public var usableDatagramFrameSize: Swift.Int
extern const CFStringRef _Nonnull kNWErrorDomainWiFiAware

Conformances

Foundation.JSONDecoder
Network.NetworkDecoder
Foundation.JSONEncoder
Network.NetworkEncoder
Foundation.PropertyListDecoder
Network.NetworkDecoder
Foundation.PropertyListEncoder
Network.NetworkEncoder
NWParameters
Network.NWParametersProvider
NWPath.LinkQuality
Swift.Equatable
NWPath.LinkQuality
Swift.Hashable
QUICStream.Directionality
Swift.Hashable
QUICStream.Initiator
Swift.Hashable
Swift.Int16
Network.NetworkFixedWidthInteger
Swift.Int32
Network.NetworkFixedWidthInteger
Swift.Int64
Network.NetworkFixedWidthInteger
Swift.Int8
Network.NetworkFixedWidthInteger
Swift.UInt16
Network.NetworkFixedWidthInteger
Swift.UInt32
Network.NetworkFixedWidthInteger
Swift.UInt64
Network.NetworkFixedWidthInteger
Swift.UInt8
Network.NetworkFixedWidthInteger
TLS.PeerAuthentication
Swift.Equatable
TLS.PeerAuthentication
Swift.Hashable

Initializers

Coder
public init<BelowProtocol>(_ type: Sending.Type, using: CoderType, @Network.ProtocolStackBuilder<BelowProtocol> _ builder: () -> BelowProtocol) where BelowProtocol : Network.StreamProtocol
Coder
public init<BelowProtocol>(_ type: Sending.Type, using: CoderType, @Network.ProtocolStackBuilder<BelowProtocol> _ builder: () -> BelowProtocol) where BelowProtocol : Network.DatagramProtocol
NetworkConnection
convenience public init(to endpoint: Network.NWEndpoint, @Network.ProtocolStackBuilder<ApplicationProtocol> using builder: () -> ApplicationProtocol)
NetworkConnection
convenience public init(to provider: any Network.Connectable, @Network.ProtocolStackBuilder<ApplicationProtocol> using builder: () -> ApplicationProtocol)
NetworkConnection
convenience public init(to endpoint: Network.NWEndpoint, using builder: Network.NWParametersBuilder<ApplicationProtocol>)
NetworkConnection
convenience public init(to provider: any Network.Connectable, using builder: Network.NWParametersBuilder<ApplicationProtocol>)
NetworkConnection
convenience public init(to endpoint: Network.NWEndpoint, @Network.ProtocolStackBuilder<ApplicationProtocol> using builder: () -> ApplicationProtocol)
NetworkConnection
convenience public init(to provider: any Network.Connectable, @Network.ProtocolStackBuilder<ApplicationProtocol> using builder: () -> ApplicationProtocol)
NetworkConnection
convenience public init(to endpoint: Network.NWEndpoint, using builder: Network.NWParametersBuilder<ApplicationProtocol>)
NetworkConnection
convenience public init(to provider: any Network.Connectable, using builder: Network.NWParametersBuilder<ApplicationProtocol>)

Enum Cases

NWError
case wifiAware(Swift.Int32)
nw_error_domain_wifi_aware = 4
nw_error_domain_wifi_aware = 4