Commit Graph

5 Commits

Author SHA1 Message Date
Johannes Weiss d68f9d1f8e make NIOTS compile on Linux (#29)
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).
2019-03-25 16:49:35 +02:00
Johannes Weiss 1d0cb1040e
don't retain everything until connect timeout expires (#30)
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
2019-03-22 15:40:02 +00:00
Cory Benfield 971a6a37ec Bring patches up to new NIO 2 master (#23) 2019-02-26 12:13:54 +00:00
Johannes Weiss 9fa52bd443 use to NIO 2 (from master branch) and Swift 5 (#18)
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
2019-01-18 13:03:21 +00:00
Cory Benfield 6475881aea Initial commit 2018-07-18 17:11:24 +01:00