apple / swift-nio-transport-services

Extensions for SwiftNIO to support Apple platforms as first-class citizens.
https://swiftpackageindex.com/apple/swift-nio-transport-services/main/documentation/niotransportservices
Apache License 2.0
282 stars 71 forks source link

State Managed Listeners #175

Closed Joannis closed 1 year ago

Joannis commented 1 year ago

Extract the NWListener code into StateManagedListenerChannel

Motivation:

When implementing #68, a lot of code ended up being identical between TCP and UDP. Like #174, this PR paves the way to adding UDP, with very little overhead code. It moves the code that is used to represent NWListener as a Channel into its own protocol, that can then be applied to both TCP and UDP implementations.

Modifications:

Result:

This makes implementing UDP much simpler, and without redundant code.

Notes

This PR works off #174 , and should therefore be viewed as a diff based on #174 to get a clean picture.

Lukasa commented 1 year ago

@Joannis any chance you can rebase this on the new main for easier review?

Joannis commented 1 year ago

Will do @Lukasa , doing so now

Joannis commented 1 year ago

@Lukasa ready for review again