Allow passing raw fd's into ServerSocket#4156
Merged
matejk merged 5 commits intopocoproject:develfrom Dec 4, 2023
Merged
Conversation
Contributor
Author
|
I'm marking this as draft as I realize that it's a breaking change due to the very similar constructor with port. Maybe instead of a constructor this case should be supported with constructing a default instance then calling a .useFd function or something? |
994e1a9 to
2418861
Compare
Contributor
Author
|
Ok, I think this is a better approach to avoid issues with implicit integer conversion and to make this API use a bit more explicit at callsites. Thanks for reviewing :) |
aleks-f
requested changes
Nov 27, 2023
Contributor
Author
|
I've added a test. I'm not on windows at the moment so haven't tested that the windows portion builds/runs, but it works on Linux. |
Contributor
Author
|
Okay, test build+passes on Windows now |
Contributor
|
Code compiles on macOS (clang 15.0.0), unit tests pass. |
matejk
reviewed
Dec 4, 2023
Contributor
matejk
left a comment
There was a problem hiding this comment.
I approve the changes with only one minor comment from my side.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I'm writing an application that receives a fd from systemd that's bound on port 80, and I would like Poco to be able to host the server on the fd that I receive.
This code enables this usecase. I've tested it and it works well