-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Allow passing raw fd's into ServerSocket #4156
Conversation
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
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 :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a test case here, please
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. |
Okay, test build+passes on Windows now |
Code compiles on macOS (clang 15.0.0), unit tests pass. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I approve the changes with only one minor comment from my side.
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