# Motivation
The default implementation of `SerialExecutor` for `EventLoop`s causes a lot of allocations that's why we added a new customization point to allow `EventLoop`s to implement fast paths.
# Modification
This PR adds the customization point to `NIOTSEventLoop`.
Motivation:
Now that Swift 5.9 is GM we should update the supported versions and
remove 5.6
Modifications:
* Update `Package.swift`
* Delete the 5.6 docker compose file and make a 5.10 one
* Update docs
Result:
Remove support for Swift 5.6, add 5.10
Motivation:
There was a typo when setting the allowLocalEndpointReuse channel option, where it was cast to NIOTSEnablePeerToPeerOption.Value
instead of NIOTSAllowLocalEndpointReuse.Value. Both of these types are Bools, so this wouldn't cause any actual issues, this change
is to more to keep the code consistent, and reduce confusion for future contributors or others reading the code base.
Modifications:
This commit casts the allowLocalEndpointReuse property in StateManagedListenerChannel and StateManagedNWConnectionChannel.
Result:
The typo is fixed after this change.
Motivation:
The datagram tests use a handler which sets its event loop in
`channelRegistered`. A function on the handler is called which relies on
the EL being set. However, this can race: the function can be called
before `channelRegistered` is called.
Modifications:
- set the EL in `handlerAdded`
Result:
Fewer crashes
Motivation:
This change was made because UDP support was lacking on iOS. It's needed by my DNS client implementation, which I am in turn using for an iOS app I'm working on relying on SRV typed records.
Modifications:
Adds a NIOTSDatagramListenerBootstrap for making UDP services
Adds a NIOTSDatagramListenerChannel that accepts UDP connections
Adds a NIOTSDatagramChannel for UDP client connections
Adds a NIOTSDatagramBootstrap that can create a new UDP client
# Motivation
We want to release a new `NIOTS` version without the SPI changes for now.
# Modification
This PR backs out the new `NIOAsyncChannel` APIs.
# Result
No more SPI usage so we can safely release.
# Motivation
We had some breaking changes in the NIO AsyncChannel SPI which we have to adapt here.
# Modification
This PR updates to the latest AsyncChannel SPI
# Result
No more warnings and errors when building.
# Motivation
After my recent PR we failed to compile on 5.6 since the compiler isn't capable to infer the return type of one of the closures.
# Modification
This PR adds the closure's return type explicitly.
# Result
Compiling on 5.6 again
# Motivation
We introduced some breaking SPI(AsyncChannel) changes in NIO that we have to adopt here.
# Modification
This PR adopts the latest `NIOProtocolNegotiationResult` APIs. Additionally, it also drops all bind/connect methods on the bootstraps that are specific to protocol negotiation or `NIOAsyncChannel`.
# Result
Green CI on `main` and alignment between `NIOPosix` and `NIOTS.
# Motivation
We introduced a new configuration struct for `NIOAsyncChannel` to make handling and configuring it easier.
# Modification
This PR adopts the new APIs.
# Result
Less boilerplate in our bootstrap methods
* Extract the NWConnection code into StateManagedNWConnectionChannel
* Add a general setup for NWListener implementations
* Add support for UDPOptions as a NWOptionsProtocol type
* Complete the rebase to main
* Fix nits from PR review
* Clean up some of the invalid rebase
* Extract the NWConnection code into StateManagedNWConnectionChannel
* Process cory's feedback
* Remove dead code whose functionality is already handled by the helper protocol
* Make the address cache non-locked, because its lock has been moved to the accessors
* Move getting the Multipath option into the TCP channel, re-introduce the underscores to the addressCache properties
* Drop the umbrella import
---------
Co-authored-by: Cory Benfield <lukasa@apple.com>
* Async methods for `NIOTSListenerBootstrap` and `NIOTSConnectionBootstrap`
# Motivation
We want to support async bootstrapping with all our bootstraps.
# Modification
This PR adds support for the `NIOTSListenerBootstrap` and `NIOTSConnectionBootstrap`. It also adds the three variants of methods to it (abstract output, `NIOAsyncChannel` based and protocol negotiation based)
# Result
We now support asynchronous interaction with the `NIOTSListenerBootstrap` and `NIOTSConnectionBootstrap`
* Use protocolHandlers properly
* Update NIO version
* code review
* REview
* Doc indention
Motivation:
We're centralizing on the Swift code of conduct, so we'll x-reference
that instead of holding our own.
Modifications:
Hyperlink out to Swift.
Result:
Shared CoC across the projects.
### Motivation
`swift-nio` has deprecated `NIOPreconcurrencySendable` in `2.51.0`. Removing the protocol conformance would be an API breaking change. Keeping the conformance is low cost and not worth the risk.
### Changes
- replace `NIOPreconcurrencySendable` with underscore version `_NIOPreconcurrencySendable`
### Result
We compile again with the latest `swift-nio` release without warnings
* Drop support for Swift 5.5
Signed-off-by: Si Beaumont <beaumont@apple.com>
* fixup: Next version will be 1.17.0
Signed-off-by: Si Beaumont <beaumont@apple.com>
---------
Signed-off-by: Si Beaumont <beaumont@apple.com>
Motivation:
We try to support building our docs on Linux too, but that means we
can't explicitly reference any symbols from `index.md`.
Modifications:
Enable CI-ing docs.
Result:
Docs will render on Linux too.
Motivation:
The NIO docs are now published on the Swift Package Index but the README
still refers to GitHub pages.
Modifications:
- Update README and other docs to point to Swift Package Index.
Result:
Documentation links work
Motivation
As we've rolled out support for multicast on Linux, it makes sense to
add equivalent configuration for swift-nio-transport-services. The two
features aren't one-to-one, as Network.framework has substantially more
capability than the Linux functionality.
Modifications
- Expose a multipathServiceType channel option
- Add a test to confirm we use it properly
Result
Multicast service types are available.
Motivation:
#fileID introduced in Swift 5.3, so no longer need to use #file anywhere
Modifications:
Changed #file to #filePath or #fileID depending on situation
* Allow retrieval of metadata for a specific protocol from the underlying `NWConnection`
* Address review comments
* Address review comment
* Add availability annotation to tests
* Rename `NIOTSChannelIsNotATransportServicesChannel ` to `NIOTSChannelIsNotANIOTSConnectionChannel `
Motivation:
SwiftNIO periodically drops support for older Swift versions. Now that
5.7 has been released, 5.4 will be dropped.
Modifications:
- Remove 5.4 specific Package.swift and docker-compose
- Update the 5.7 docker-compose to use the released 5.7 and move from
focal (2004) to jammy (2204)
- Update docs
Results:
Minimum Swift version is 5.5
Motivation:
- NIOTSConnectionBootstrap was extended to be marked as non-Sendable,
this extenion missed the availability annotations.
Modifications:
- Add appropriate availability annotation
Result:
Resolves#159
Motivation:
Lock has been deprecated in favour of NIOLock. Warnings aren't great.
Modifications:
- Replace Lock with NIOLock
- Update the minimum required NIO version to 2.42.0.
Result:
Everything builds cleanly
NIO Transport Services is not capable of launching services with existing NWConnection or NWListener objects. Being able to get
an existing NWConnection through a connection bootstrap and into a channel is a useful capability for advanced use cases.
Modifications:
* Added an option to bootstrap with existing NWListener and NWConnection
* Completed promise connection earlier within NIOTSChannels when AlreadyConfigured is called
* Added test with new NWConnection and NWListener to register Channels
Result:
Able to create and register a channel using an existing NWListener and NWConnection
Motivation
Documentation is nice, and we can help support users by providing useful
clear docs.
Modifications
Add Docc to 5.6 and later builds
Make sure symbol references work
Add overview docs
Result
Nice rendering docs
Motivation:
Right now we're playing a little fast and loose with the lifetimes of
the sec_protocol_metadata_t. As a practical matter it is highly likely
that this is owned (and so kept alive by) the NWConnection, but rather
than risk that we should tighten up the lifetime management.
Modifications:
Use withExtendedLifetime to extend the lifetime.
Result:
Better lifetime management.
Motivation:
We no longer support Cocoapods and `swift package generate-xcodeproj` is
deprecated, so we shouldn't advertise their usage in the README.
Modifications:
Remove Cocoapods and `swift package generate-xcodeproj` sections from
the README.
Result:
More up-to-date README
Motivation:
When we're waiting for connectivity, the user might tell us that they
aren't interested in waiting. In that case we take advantage of the
signal and close early.
However, the code as-written had a bug: we didn't care whether the user
told us they _didn't_ want to wait, or they _did_: we just closed
because they had an opinion! That's no good! We should only close if
they don't want to wait.
Modifications:
- Only close if the user doesn't want to wait.
- Add tests
Result:
We won't close if users don't want us to.
Motivation:
Private Relay kicks in to secure unencrypted data transfers, and
connections to port 80 are a good signal. As a result, the current
construction of this test will invoke Private Relay and attempt to route
over it.
While Private Relay is in beta this is a bad outcome, as it risks
causing bugs in unusual network scenarios. So let's tell Private Relay
we don't need it.
Modifications:
Pretend we're gonna connect to 443 instead.
Result:
More reliable test.
Motivation:
To workaround https://github.com/apple/swift-nio/issues/2073 we must
list all transitive dependencies when building podspecs.
Modifications:
- Include transitive dependencies in the build_podspec script
- The list of dependencies was generated using
the `list_transitive_dependencies.py` from the NIO repo.
Result:
Podspec generation script includes transitive dependencies.
As outlined in a [Swift forums post in November ’21](https://forums.swift.org/t/swiftnio-swift-version-support/53232), SwiftNIO will only support the latest non-patch Swift release and the 2 immediately prior non-patch versions.
- drop support for Swift 5.2 and 5.3.
- update CI for Swift 5.4 to run on bionic instead of focal to ensure that we still test bionic.
- add a CI job for Swift 5.7
Motivation:
When a task is scheduled using a `DispatchTimerSource` on a `NIOTSEventLoop`
the source is retain via a callback on the promise associated with the
scheduled task. This stops the source from deinit'd before the task is
run. However, the callback being added is an implementation details of
`Scheduled` and the retain cycle is incidental.
If that detail chnaged (such as in
https://github.com/apple/swift-nio/pull/2011) then tasks may not run and
the promise could be leaked.
Modifications:
- Explicitly add a retain cycle between the future and the timer source
which is broken by the promise being completed and callbacks run.
Result:
The timer source is kept alive until the event fires.
Motivation:
With NIO 2.32.0 we broke the core NIO module up into modules that split
apart the POSIX layer and the core abstractions. As a result, this
package no longer needs to express a hard dependency on the POSIX layer.
Modifications:
- Rewrote imports of NIO to NIOCore.
- Added NIOEmbedded imports where necessary in tests.
- Note that the main package still _depends_ on NIO, which is necessary
for backwards-compatibility reasons. This dependency is unused.
Result:
No need to use NIOPosix.
Motivation:
The event loop state is not protected for access on different threads.
This means it must only be accessed from the task queue.
Modifications:
Move check for event loop shutdown into taskQueue
Result:
Event Loop state only accessed from the task queue.
Motivation:
`removeHandlers(channel:)` was deprecated in NIO 2.32.0.
Modifications:
- Raise minimum required NIO version to 2.32.0
- Use `removeHandlers(pipeline:)`
Result:
We don't use deprecated API.