Commit Graph

6 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
Cartisim Development 99d28e05f7
Added support for connection viability updates (#207)
# Enhancement: Integration of Viability Handler in `Network.framework`

We have successfully integrated the `viabilityUpdateHandler` from
`Network.framework` into `NIOTransportServices`, enabling developers to
leverage the full potential of the `Network.framework` API.

This enhancement provides adopters with critical insights into the
viability of connections to remote endpoints. By being informed about
the current network status, developers can implement a more responsive
and adaptive approach to network behavior and conditions.

## Modifications

- Introduced two new methods along with corresponding calls to these
methods within the `Network.framework` handler.
- These handlers trigger the `NIO` *InboundEventsTriggered* method,
allowing consumers to respond to network changes effectively.
- Developed two structs within *NIOTSNetworkEvents* to accompany the
*InboundEventsTriggered* methods, ensuring seamless data transfer.
- Conformed these structs to Sendability for compatibility with the
required operating systems.

## Result

Clients can now receive viability events from `Network.framework`,
enhancing their ability to manage network connections dynamically

---------

Co-authored-by: George Barnett <gbarnett@apple.com>
Co-authored-by: Cory Benfield <lukasa@apple.com>
2024-09-16 14:11:19 +01:00
Cartisim Development 16ca413e3f
Fire the pipelines error caught method when NWConnection's state changes to failed (#187)
* Fire the pipelines  error caughted method when NWConnection's state changes to failed

* Added check if failed error is ChannelError.eof and added a unit test for forwarding failed connnection state errors

* Completing a promise for the error caught

* Fixed Typo

* Removed whitespace

* Binding the listener to port 0 and connecting to listerner's localAddress
2023-10-25 09:22:53 +01:00
Rayman Rosevear e4f1815b6a
Fix a typo when casting the allowLocalEndpointReuse channel option value (#186)
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.
2023-09-25 07:34:20 +01:00
Joannis Orlandos 7a18352b5e
Extract the NWConnection code into StateManagedNWConnectionChannel (#174)
* 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>
2023-07-08 12:41:46 +01:00