Commit Graph

18 Commits

Author SHA1 Message Date
Rick Newton-Rogers c73112efc0
Migrate CI to use GitHub Actions. (#213)
### Motivation:

To migrate to GitHub actions and centralised infrastructure.

### Modifications:

Changes of note:
* Adopt swift-format using rules from SwiftNIO. Modified so that it
ignores `NoAssignmentInExpressions` in some `XCTAssert` functions.
* Remove scripts and docker files which are no longer needed

### Result:

Feature parity with old CI.
2024-10-28 09:51:24 +00:00
Clinton Nkwocha bbd5e63cf9
Provide configurability for receiving connection data (#212)
Motivation:

Users are stuck with the hardcoded parameters for receiving data from a
connection.

Modifications:

- Add new options to `NIOTSChannelOptions` for configuring how to
receive data from a connection.

Result:

Users can configure how they receive data from a connection.
2024-10-17 13:14:45 +01:00
Cory Benfield 38ac8221dd
Add ChannelOptions to extract base types. (#203)
Motivation:

In some cases users may want to access APIs we haven't exposed
in NIOTransportServices. We should have a fallback that allows users
to do this.

Modifications:

- Add ChannelOptions for getting NWConnection and NWListener.

Result:

Users have an escape hatch
2024-05-13 18:30:13 +01:00
Si Beaumont dd408dc2d4
Drop support for Swift 5.5 (#172)
* 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>
2023-04-14 17:06:35 +01:00
Cory Benfield e676b1f044
Expose multicast service type (#165)
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.
2022-11-09 11:00:20 +00:00
David Nadoba c2e373fec5
Adopt `Sendable` (#155)
* Adopt `Sendable`

* Workaround Swift 5.4 compiler bug
2022-08-31 16:22:32 +01:00
Cory Benfield 4e02d9cf35
Use Docc for documentation (#154)
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
2022-07-29 15:02:01 +01:00
Cory Benfield e7f5278a26
Clean up imports and dependencies. (#130)
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.
2021-09-14 10:06:42 +01:00
Peter Adams cd49a10c4f
Directly support the allowLocalEndpointReuse channel option (#82)
Motivation:

The NetworkFramework directly supports the concept of allowLocalEndPointReuse. Currently to get through the nio system, this is mapped to the SO_REUSEADDR option.

Now there is a shorthand option for this, it is sad to map from allowLocalEndPointReuse to SO_REUSEADDR and back again.

Modifications:

Add a new NIOTS channel option for this setting.
Set the underlying based on any of new setting, reuseAddr or reusePort.
Add a override to interpret the shorthand option directly into the new option.
Add shorthand options for client with tests of equivalence to long options.

Result:

Behaviour is identical but we can feel happier that the option mapping is less confusing.
2020-07-01 14:51:31 +01:00
Cory Benfield f9a95e9bbb
Update watchOS availability. (#98)
Motivation:

In a patch where we added some metadata options, we accidentally set the
availability wrong. This is a compile-time error, so we broke watchOS
compilation.

Modifications:

Update the availability of some types on watchOS.

Result:

Users can build on watchOS again.
2020-06-19 10:19:47 +01:00
Pasi Salenius 7e330732f2
New channel options exposing properties of underlying NWConnection (#90)
* Initial draft implementation of new channel options for NWConnection.currentPath, metadata for a given NWProtocol, establishment report and data transfer report. Add a new error for not existing connection. Add tests for all of these. The data transfer report option has to be implemented in another way, as the collection of the final data transfer report does not seem very straightforward.

* Fix incorrect available attributes. Make the Value of NIOTSEstablishmentReportOption an EventLoopFuture returning an optional report. Move handling of NIOTSEstablishmentReportOption and NIOTSDataTransferReportOption to getOption0. Remove nwConnection0().

* Use full type on currentPath too.

* Add a DispatchQueue to do collect of the pending data transfer report, use a DispatchGroup to wait for completion of report collection. Remove redundant attribute. Fix nits related to spacing and file header.

* Fix available attributes for tests too.
2020-06-01 11:52:56 +01:00
Johannes Weiss cefc7014fc
fix license headers (#73) 2020-03-25 15:43:40 +00:00
Cory Benfield e30bf63ea1 Namespace ChannelOptions. (#61)
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.
2019-10-23 17:26:25 -07:00
Cory Benfield b0b3ba5e7f Make NIO Transport Services available on watchOS 6 (#47)
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
2019-06-06 22:24:27 -07:00
George Barnett 3d0713dc43 Annotate code with availability attributes (#42)
* 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.
2019-05-10 19:02:02 +01:00
Johannes Weiss 15fe53093c update to latest NIO 2 (#26)
Motivation:

Code should compile and have the latest NIO 2 API.

Modifications:

- rename `ctx` to `context`
- apply all fixits

Result:

compiles again
2019-02-26 13:01:17 +00:00
Cory Benfield 72f0815335 Support setting enablePeerToPeer. (#22) (#24)
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)
2019-02-11 13:12:18 +01:00
Cory Benfield 5840333f0a Support opting-out of Network.framework waiting state. (#15)
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.
2018-12-03 11:28:20 +00:00