Motivation:
Syncing onto the event loop queues is essentially never acceptable: we
can't appropriately guard against it going terribly wrong.
Modifications:
- Use locks instead, locks are good.
Result:
Removes some crashes.
Resolves#70.
Motivation:
We deprecated Atomic because we made a new, better one. We should use
it.
Modifications:
Replaced all use of Atomic with NIOAtomic.
Result:
Better performance, fewer compiler warnings.
Motivation:
In NIO 2.9.0 we moved all first-party `ChannelOption` types into their
own namespace. That was a good idea, but NIOTS uses them too and so it
now encounters build warnings. Additionally, NIOTS defines its own
`ChannelOption`s, and so should namespace those as well.
Modifications:
- Updated the code to use the namespaced `ChannelOption` types.
- Namespaced our own.
Result:
More namespacing.
Motivation:
When autoRead is on, the pipeline must observe the read calls in order
to be able to exert backpressure. Otherwise, autoRead is a
zero-backpressure mode, which isn't great.
Correctly call pipeline.read instead of self.read0 to avoid this.
Modifications:
- Updated NIOTSConnectionChannel to call pipeline.read().
Result:
Backpressure can be exerted.
Motivation:
With Network.framework becoming available on watchOS, you should now be
able to run your favourite NIO applications on watchOS 6!
Modifications:
Updated availability annotations to allow NIO TS.
Result:
More NIO on more watches
* Annotate code with availability attributes
Motivation:
It was not possible to import NIOTS into a project where
Network.framework was not supported by all deployment targets.
Modifications:
All NIOTS code, where applicable, was annotated with availability
attributes.
Result:
It is possible for application developers to import NIOTS on platforms
which do not support Network.framework without a compile time error.
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:
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:
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:
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:
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.