-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Valid port numbers not representable #275
Comments
Thank you for reporting this limitation. We are aware of this problem - unfortunately as changing the type of a public enum's associated value case is a SemVer Major change we are stuck with this until we decide to do Kitura-net 3.0.0. We don't have any current plans to do so as the server-side ecosystem including Kitura is migrating to https://github.com/apple/swift-nio and hence Kitura-net is gradually becoming obsolete. So unless anyone can think of a way we can fix this without breaking SemVer Major, this is probably WONTFIX :( |
Thanks for the response. Maybe an ugly fix/workaround could be to introduce a new enum |
🤢 😀 |
@ianpartridge I recently ran into this, and was considering the workaround proposed above. I agree it would be ugly to introduce a 'new' API, however we wouldn't have to live with it indefinitely, and could fix it properly in the next Kitura-net / Kitura-NIO major. This issue also affects Kitura-CouchDB since it is built on top of ClientRequest. |
@pushkarnk proposed a neat workaround for this in Kitura/Kitura-NIO#140 which I've replicated in #285. @Fryie would this be sufficient for now? |
Kitura-net 2.1.4 and Kitura-NIO 1.0.9 have been tagged with #285 which provides this workaround:
|
The
ClientRequest.Options
enum assumes that port numbers will be represented by a signed 16-bit integer. However, valid port numbers are actually unsigned 16-bit integers.This means that port numbers 32768-65535 (which are supposed to be valid) cannot be represented. In particular, it means that all dynamic ports won't work.
The text was updated successfully, but these errors were encountered: