Motivation:
NIOTS will not work on Linux but we can at least make it not fail
compilation when compiled on Linux. That way consumers of the API can
depend on NIOTS but make sure they only use NIOTS when wrapped in a
`#if canImport(Network)` block.
Modification:
Guard everything by `#if canImport(Network)`
Result:
This package will now build on Linux (without providing any useful
code).
Motivation:
When entering convergence we incorrectly specified a branch dependency
for something that is actually a tag.
Modifications:
- Remove branch dependency, use from: instead.
Result:
Users can use this repo!
Motivation:
Previously we would use the combination of DispatchQueue.asyncAfter and
a DispatchWorkItem for the connect timeout. If the connection succeeded
we would just cancel the DispatchWorkItem. Unfortunately that will still
keep everything that's captured in the DispatchWorkItem alive until the
deadline has come (because DispatchWorkItem is just a dumb wrapper over
a closure).
Modifications:
use a DispatchSource of type timer source instead.
Result:
- we won't keep the ELG/EL/Channel/... alive until at least the connect
timeout expires.
- fixes#28
Motivation:
Once every few thousand years, an event called syzygy (or "convergence")
occurs in our solar system. When these events occur, the fabric of spacetime
becomes thin, allowing reflections of a possible future to appear in our
reality.
This gives a few brave souls the opportunity to experience a future: a
possibility of the way the universe may one day be. But be warned: to
toy with causality is to risk unbearable pain and suffering. Only the
bravest of souls should look too closely at these shadows of the future.
Modifications:
- Chose a firm anchor point in the SwiftNIO timeline.
- Removed the braces that kept time travellers safe.
- Said a quiet prayer.
Result:
Opportunity.
Motivation:
Some users may wish to use peer-to-peer networking with bonjour.
Modifications:
Expose peer-to-peer networking via a new channel option.
Result:
Users will be able to use peer-to-peer networking
(cherry picked from commit e9c1e41fd1)
Motivation:
Compiling code is good so let's make it compile again with the latest
NIO APIs.
Modifications:
- made NIOTS use `_NIO1APIShims`
- clicked 'Fix All' a couple of times to adjust the API
Result:
Code compiles again
Motivation:
SwiftPM from Swift 5.0 brings targets that only support certain systems
which is really handy for this package as it only support macOS 10.14+
and iOS/tvOS 12+
Modifications:
- made use of the Swift 5.0 manifests which can have restrictions on the
supported platforms
- adapted to NIO 2
Result:
- better development story
- using the latest & greatest
Motivation:
In some cases, such as when an event loop has been shutdown, channel
registration may fail. In these cases, we would incorrectly attempt to
deregister the channel, which would fail (and in debug builds, assert).
Really, we shouldn't transition into .registered until we know that we have,
in fact, registered.
However, we need to be cautious: we don't want to register unless we
believe we're in an acceptable state to register.
Modifications:
Updated the state enum to perform the registration at the correct
part of the state change function.
Result:
Harder to crash in debug mode
Motivation:
We were inadvertently modifying the registration information of
NIOTSEventLoop objects from multiple threads, which is very not good.
Modifications:
Add an event loop execute to hop loops.
Result:
Thread safe!
Motivation:
Sadly I overlooked the fact that Channel.isActive is supposed to be
safe to call from multiple threads: the implementation here was not.
Modifications:
Store the active state into an Atomic.
Result:
It will be thread-safe to ask if a channel is active.
Motivation:
In some cases users may prefer not to wait for Network.framework to
reattempt connection in the future. Users should be able to opt-out of the
default waiting behaviour in those cases.
Modifications:
- Added WaitForActivity ChannelOption.
Result:
Users can configure channels better.
Motivation:
It is possible to receive the dataReceived callback after we've called
cancel, mostly because there may be such a block in place in the queue
before that cancel call fires. We should tolerate that.
Modifications:
Removed the invalid assertion.
Result:
Fewer failures.
Motivation:
If the user sets an unsupported ChannelOption we should give the best
diagnostics possible.
Modifications:
Add the ChannelOption type to the error message that it's unsupported.
Result:
Happier users
Motivation:
In SwiftNIO 1.11 we shipped improved interfaces for Channels to support
asserting being in the event loop. This is necessary because Dispatch
provides no non-precondition way to 100% guarantee that you are on a
specific queue, which is a requirement for accurate behaviour of
inEventLoop.
Modifications:
- Added an implementation of preconditionInEventLoop.
- Changed all assertions to use new interface.
- Required NIO 1.11.
Result:
Accurate assertions
Motivation:
One bugfix, some cleanliness.
Modifications:
`NIOTSListenerChannel.doClose0()` now evaluates and updates `self.bindPromise` irrespective of whether `self.nwListener` had been set.
Also, some case statements could be better: I've swapped `case _ as Thing:` with `case is Thing:`, and I've inlined the `let` value from `case _ as Thing: let thing = x as! Thing` to simply be `case let x as Thing:`.
Result:
If the call to create the `NWListener` in `NIOTSListenerChannel.beginActivating0()` throws an error, any promise passed to that method will now correctly be updated, where before it would be silently ignored, potentially causing a waiting caller to wait forever.
Also, no case statements remain that might cause damage to my tooth enamel.
* Use DispatchWorkItem.cancel() for cancellation. Make StateManagedChannel.beginActivating() use the same methodology as all the others.
* A needless `if let x = opt` that could be replaced with a question mark.
Motivation:
Today, SwiftPM unfortunately doesn't offer a great story for macOS/iOS
App development. Therefore we should recommend the
SwiftNIO/SwiftNIOTransportServices Pods.
Modifications:
recommend CocoaPods in the readme
Result:
Hopefully less frustration.
Motivation:
A number of users have asked for the ability to install
NIOTransportServices via Cocoapods. This is an entirely reasonable
request, so let's do it.
Modifications:
Added a script that can generate, and optionally upload, a specfile
for NIOTransportServices.
Result:
Users can use cocoapods if they prefer.
Motivation:
If an error is encountered early in the bootstrap process we should
probably not hit an assertion.
Modifications:
Added tests that we don't crash when closing idle channels.
Result:
Fewer crashes.
Motivation:
These are commonly-set socket options for channels, and we should
support them when using Transport Services as well.
Modifications:
Pass the socket options through to allowLocalEndpointReuse.
Result:
SO_REUSEADDR and SO_REUSEPORT will be available.