diff --git a/Sources/NIOTSHTTPClient/main.swift b/Sources/NIOTSHTTPClient/main.swift index c936385..9cd04c0 100644 --- a/Sources/NIOTSHTTPClient/main.swift +++ b/Sources/NIOTSHTTPClient/main.swift @@ -20,7 +20,7 @@ import NIOTransportServices import NIOHTTP1 import Network -@available(OSX 10.14, iOS 12.0, tvOS 12.0, *) +@available(OSX 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *) final class HTTP1ClientHandler: ChannelInboundHandler { typealias OutboundOut = HTTPClientRequestPart typealias InboundIn = HTTPClientResponsePart diff --git a/Sources/NIOTSHTTPServer/main.swift b/Sources/NIOTSHTTPServer/main.swift index 9ffb90e..83267aa 100644 --- a/Sources/NIOTSHTTPServer/main.swift +++ b/Sources/NIOTSHTTPServer/main.swift @@ -20,7 +20,7 @@ import NIOTransportServices import NIOHTTP1 import Network -@available(OSX 10.14, iOS 12.0, tvOS 12.0, *) +@available(OSX 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *) final class HTTP1ServerHandler: ChannelInboundHandler { typealias InboundIn = HTTPServerRequestPart typealias OutboundOut = HTTPServerResponsePart diff --git a/Sources/NIOTransportServices/NIOTSChannelOptions.swift b/Sources/NIOTransportServices/NIOTSChannelOptions.swift index 46fff6b..c8417c3 100644 --- a/Sources/NIOTransportServices/NIOTSChannelOptions.swift +++ b/Sources/NIOTransportServices/NIOTSChannelOptions.swift @@ -25,7 +25,7 @@ import NIO /// transitioning into the `failed` state, causing immediate connection failure. /// /// This option is only valid with `NIOTSConnectionBootstrap`. -@available(OSX 10.14, iOS 12.0, tvOS 12.0, *) +@available(OSX 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *) public struct NIOTSWaitForActivityOption: ChannelOption, Equatable { public typealias Value = Bool @@ -38,7 +38,7 @@ public struct NIOTSWaitForActivityOption: ChannelOption, Equatable { /// `true`. By default this option is set to `false`. /// /// This option must be set on the bootstrap: setting it after the channel is initialized will have no effect. -@available(OSX 10.14, iOS 12.0, tvOS 12.0, *) +@available(OSX 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *) public struct NIOTSEnablePeerToPeerOption: ChannelOption, Equatable { public typealias Value = Bool @@ -47,7 +47,7 @@ public struct NIOTSEnablePeerToPeerOption: ChannelOption, Equatable { /// Options that can be set explicitly and only on bootstraps provided by `NIOTransportServices`. -@available(OSX 10.14, iOS 12.0, tvOS 12.0, *) +@available(OSX 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *) public struct NIOTSChannelOptions { /// - seealso: `NIOTSWaitForActivityOption`. public static let waitForActivity = NIOTSWaitForActivityOption() diff --git a/Sources/NIOTransportServices/NIOTSConnectionBootstrap.swift b/Sources/NIOTransportServices/NIOTSConnectionBootstrap.swift index 28d72b1..84a126f 100644 --- a/Sources/NIOTransportServices/NIOTSConnectionBootstrap.swift +++ b/Sources/NIOTransportServices/NIOTSConnectionBootstrap.swift @@ -19,7 +19,7 @@ import NIO import Dispatch import Network -@available(OSX 10.14, iOS 12.0, tvOS 12.0, *) +@available(OSX 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *) public final class NIOTSConnectionBootstrap { private let group: NIOTSEventLoopGroup private var channelInitializer: ((Channel) -> EventLoopFuture)? @@ -178,7 +178,7 @@ public final class NIOTSConnectionBootstrap { // This is a backport of ChannelOptions.Storage from SwiftNIO because the initializer wasn't public, so we couldn't actually build it. // When https://github.com/apple/swift-nio/pull/988 is in a shipped release, we can remove this and simply bump our lowest supported version of SwiftNIO. -@available(OSX 10.14, iOS 12.0, tvOS 12.0, *) +@available(OSX 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *) internal struct ChannelOptionsStorage { internal var _storage: [(Any, (Any, (Channel) -> (Any, Any) -> EventLoopFuture))] = [] diff --git a/Sources/NIOTransportServices/NIOTSConnectionChannel.swift b/Sources/NIOTransportServices/NIOTSConnectionChannel.swift index 2c5bcfb..963b0e7 100644 --- a/Sources/NIOTransportServices/NIOTSConnectionChannel.swift +++ b/Sources/NIOTransportServices/NIOTSConnectionChannel.swift @@ -25,7 +25,7 @@ import Network import Security /// Execute the given function and synchronously complete the given `EventLoopPromise` (if not `nil`). -@available(OSX 10.14, iOS 12.0, tvOS 12.0, *) +@available(OSX 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *) func executeAndComplete(_ promise: EventLoopPromise?, _ body: () throws -> T) { do { let result = try body() @@ -36,7 +36,7 @@ func executeAndComplete(_ promise: EventLoopPromise?, _ body: () throws -> } /// Merge two possible promises together such that firing the result will fire both. -@available(OSX 10.14, iOS 12.0, tvOS 12.0, *) +@available(OSX 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *) private func mergePromises(_ first: EventLoopPromise?, _ second: EventLoopPromise?) -> EventLoopPromise? { if let first = first { if let second = second { @@ -50,7 +50,7 @@ private func mergePromises(_ first: EventLoopPromise?, _ second: EventLoop /// Channel options for the connection channel. -@available(OSX 10.14, iOS 12.0, tvOS 12.0, *) +@available(OSX 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *) private struct ConnectionChannelOptions { /// Whether autoRead is enabled for this channel. internal var autoRead: Bool = true @@ -68,7 +68,7 @@ private typealias PendingWrite = (data: ByteBuffer, promise: EventLoopPromise Void) -> Void @@ -45,7 +45,7 @@ public protocol QoSEventLoop: EventLoop { /// new registrations, but it will continue to accept new scheduled work items. When a loop is closed, it /// will accept neither new registrations nor new scheduled work items, but it will continue to process /// the queue until it has drained. -@available(OSX 10.14, iOS 12.0, tvOS 12.0, *) +@available(OSX 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *) fileprivate enum LifecycleState { case active case closing @@ -53,7 +53,7 @@ fileprivate enum LifecycleState { } -@available(OSX 10.14, iOS 12.0, tvOS 12.0, *) +@available(OSX 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *) internal class NIOTSEventLoop: QoSEventLoop { private let loop: DispatchQueue private let taskQueue: DispatchQueue @@ -156,7 +156,7 @@ internal class NIOTSEventLoop: QoSEventLoop { } } -@available(OSX 10.14, iOS 12.0, tvOS 12.0, *) +@available(OSX 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *) extension NIOTSEventLoop { /// Create a `DispatchQueue` to use for events on a given `Channel`. /// @@ -169,7 +169,7 @@ extension NIOTSEventLoop { } } -@available(OSX 10.14, iOS 12.0, tvOS 12.0, *) +@available(OSX 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *) extension NIOTSEventLoop { internal func closeGently() -> EventLoopFuture { let p: EventLoopPromise = self.makePromise() @@ -208,7 +208,7 @@ extension NIOTSEventLoop { } } -@available(OSX 10.14, iOS 12.0, tvOS 12.0, *) +@available(OSX 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *) extension NIOTSEventLoop { /// Record a given channel with this event loop. internal func register(_ channel: Channel) throws { diff --git a/Sources/NIOTransportServices/NIOTSEventLoopGroup.swift b/Sources/NIOTransportServices/NIOTSEventLoopGroup.swift index d2f42f9..be20de1 100644 --- a/Sources/NIOTransportServices/NIOTSEventLoopGroup.swift +++ b/Sources/NIOTransportServices/NIOTSEventLoopGroup.swift @@ -47,7 +47,7 @@ import Network /// platforms, the `NIOTSEventLoopGroup` should be preferred over the /// `MultiThreadedEventLoopGroup`. In particular, on iOS, the `NIOTSEventLoopGroup` is the /// preferred networking backend. -@available(OSX 10.14, iOS 12.0, tvOS 12.0, *) +@available(OSX 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *) public final class NIOTSEventLoopGroup: EventLoopGroup { private let index = Atomic(value: 0) private let eventLoops: [NIOTSEventLoop] diff --git a/Sources/NIOTransportServices/NIOTSListenerBootstrap.swift b/Sources/NIOTransportServices/NIOTSListenerBootstrap.swift index 9102051..c667f8c 100644 --- a/Sources/NIOTransportServices/NIOTSListenerBootstrap.swift +++ b/Sources/NIOTransportServices/NIOTSListenerBootstrap.swift @@ -19,7 +19,7 @@ import NIO import Dispatch import Network -@available(OSX 10.14, iOS 12.0, tvOS 12.0, *) +@available(OSX 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *) public final class NIOTSListenerBootstrap { private let group: EventLoopGroup private let childGroup: NIOTSEventLoopGroup @@ -237,7 +237,7 @@ public final class NIOTSListenerBootstrap { } -@available(OSX 10.14, iOS 12.0, tvOS 12.0, *) +@available(OSX 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *) private class AcceptHandler: ChannelInboundHandler { typealias InboundIn = NIOTSConnectionChannel typealias InboundOut = NIOTSConnectionChannel diff --git a/Sources/NIOTransportServices/NIOTSListenerChannel.swift b/Sources/NIOTransportServices/NIOTSListenerChannel.swift index 19a84ec..067c606 100644 --- a/Sources/NIOTransportServices/NIOTSListenerChannel.swift +++ b/Sources/NIOTransportServices/NIOTSListenerChannel.swift @@ -22,7 +22,7 @@ import NIOConcurrencyHelpers import Dispatch import Network -@available(OSX 10.14, iOS 12.0, tvOS 12.0, *) +@available(OSX 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *) internal final class NIOTSListenerChannel { /// The `ByteBufferAllocator` for this `Channel`. public let allocator = ByteBufferAllocator() @@ -124,7 +124,7 @@ internal final class NIOTSListenerChannel { // MARK:- NIOTSListenerChannel implementation of Channel -@available(OSX 10.14, iOS 12.0, tvOS 12.0, *) +@available(OSX 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *) extension NIOTSListenerChannel: Channel { /// The `ChannelPipeline` for this `Channel`. public var pipeline: ChannelPipeline { @@ -240,7 +240,7 @@ extension NIOTSListenerChannel: Channel { // MARK:- NIOTSListenerChannel implementation of StateManagedChannel. -@available(OSX 10.14, iOS 12.0, tvOS 12.0, *) +@available(OSX 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *) extension NIOTSListenerChannel: StateManagedChannel { typealias ActiveSubstate = ListenerActiveSubstate @@ -400,7 +400,7 @@ extension NIOTSListenerChannel: StateManagedChannel { // MARK:- Implementations of the callbacks passed to NWListener. -@available(OSX 10.14, iOS 12.0, tvOS 12.0, *) +@available(OSX 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *) extension NIOTSListenerChannel { /// Called by the underlying `NWListener` when its internal state has changed. private func stateUpdateHandler(newState: NWListener.State) { @@ -447,7 +447,7 @@ extension NIOTSListenerChannel { // MARK:- Implementations of state management for the channel. -@available(OSX 10.14, iOS 12.0, tvOS 12.0, *) +@available(OSX 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *) extension NIOTSListenerChannel { /// Make the channel active. private func bindComplete0() { diff --git a/Sources/NIOTransportServices/NIOTSNetworkEvents.swift b/Sources/NIOTransportServices/NIOTSNetworkEvents.swift index cf82c26..03c1634 100644 --- a/Sources/NIOTransportServices/NIOTSNetworkEvents.swift +++ b/Sources/NIOTransportServices/NIOTSNetworkEvents.swift @@ -21,10 +21,10 @@ import NIO /// A tag protocol that can be used to cover all network events emitted by `NIOTS`. /// /// Users are strongly encouraged not to conform their own types to this protocol. -@available(OSX 10.14, iOS 12.0, tvOS 12.0, *) +@available(OSX 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *) public protocol NIOTSNetworkEvent: Equatable { } -@available(OSX 10.14, iOS 12.0, tvOS 12.0, *) +@available(OSX 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *) public enum NIOTSNetworkEvents { /// This event is fired whenever the OS has informed NIO that there is a better /// path available to the endpoint that this `Channel` is currently connected to, diff --git a/Sources/NIOTransportServices/SocketAddress+NWEndpoint.swift b/Sources/NIOTransportServices/SocketAddress+NWEndpoint.swift index 490a699..16467c4 100644 --- a/Sources/NIOTransportServices/SocketAddress+NWEndpoint.swift +++ b/Sources/NIOTransportServices/SocketAddress+NWEndpoint.swift @@ -20,7 +20,7 @@ import Foundation import NIO import Network -@available(OSX 10.14, iOS 12.0, tvOS 12.0, *) +@available(OSX 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *) extension IPv4Address { /// Create an `IPv4Address` object from a `sockaddr_in`. internal init(fromSockAddr sockAddr: sockaddr_in) { @@ -33,7 +33,7 @@ extension IPv4Address { } } -@available(OSX 10.14, iOS 12.0, tvOS 12.0, *) +@available(OSX 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *) extension IPv6Address { internal init(fromSockAddr sockAddr: sockaddr_in6) { var localAddr = sockAddr @@ -48,7 +48,7 @@ extension IPv6Address { } } -@available(OSX 10.14, iOS 12.0, tvOS 12.0, *) +@available(OSX 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *) extension NWEndpoint { /// Create an `NWEndpoint` value from a NIO `SocketAddress`. internal init(fromSocketAddress socketAddress: SocketAddress) { @@ -74,7 +74,7 @@ extension NWEndpoint { // TODO: We'll want to get rid of this when we support returning NWEndpoint directly from // the various address-handling functions. -@available(OSX 10.14, iOS 12.0, tvOS 12.0, *) +@available(OSX 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *) extension SocketAddress { internal init(fromNWEndpoint endpoint: NWEndpoint) throws { switch endpoint { @@ -110,7 +110,7 @@ extension SocketAddress { } } -@available(OSX 10.14, iOS 12.0, tvOS 12.0, *) +@available(OSX 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *) internal extension SocketAddress { /// Change the port on this `SocketAddress` to a new value. mutating func newPort(_ port: UInt16) { diff --git a/Sources/NIOTransportServices/StateManagedChannel.swift b/Sources/NIOTransportServices/StateManagedChannel.swift index 72c8bb0..68a2e0e 100644 --- a/Sources/NIOTransportServices/StateManagedChannel.swift +++ b/Sources/NIOTransportServices/StateManagedChannel.swift @@ -27,7 +27,7 @@ import Network /// active state. This can be used to provide more fine-grained tracking of states /// within the active state of a channel. Example uses include for tracking TCP half-closure /// state in a TCP stream channel. -@available(OSX 10.14, iOS 12.0, tvOS 12.0, *) +@available(OSX 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *) internal protocol ActiveChannelSubstate { /// Create the substate in its default initial state. init() @@ -35,7 +35,7 @@ internal protocol ActiveChannelSubstate { /// A state machine enum that tracks the state of the connection channel. -@available(OSX 10.14, iOS 12.0, tvOS 12.0, *) +@available(OSX 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *) internal enum ChannelState { case idle case registered @@ -85,7 +85,7 @@ internal enum ChannelState { /// The kinds of activation that a channel may support. -@available(OSX 10.14, iOS 12.0, tvOS 12.0, *) +@available(OSX 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *) internal enum ActivationType { case connect case bind @@ -98,7 +98,7 @@ internal enum ActivationType { /// This protocol provides default hooks for managing state appropriately for a /// given channel. It also provides some default implementations of `Channel` methods /// for simple behaviours. -@available(OSX 10.14, iOS 12.0, tvOS 12.0, *) +@available(OSX 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *) internal protocol StateManagedChannel: Channel, ChannelCore { associatedtype ActiveSubstate: ActiveChannelSubstate @@ -125,7 +125,7 @@ internal protocol StateManagedChannel: Channel, ChannelCore { func readIfNeeded0() -> Void } -@available(OSX 10.14, iOS 12.0, tvOS 12.0, *) +@available(OSX 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *) extension StateManagedChannel { public var eventLoop: EventLoop { return self.tsEventLoop diff --git a/Sources/NIOTransportServices/TCPOptions+SocketChannelOption.swift b/Sources/NIOTransportServices/TCPOptions+SocketChannelOption.swift index 07ebfef..f2cf5bb 100644 --- a/Sources/NIOTransportServices/TCPOptions+SocketChannelOption.swift +++ b/Sources/NIOTransportServices/TCPOptions+SocketChannelOption.swift @@ -19,7 +19,7 @@ import Foundation import NIO import Network -@available(OSX 10.14, iOS 12.0, tvOS 12.0, *) +@available(OSX 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *) internal extension NWProtocolTCP.Options { /// Apply a given channel `SocketOption` to this protocol options state. func applyChannelOption(option: SocketOption, value: SocketOptionValue) throws {