Skip to content
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

XMLRPC::Server port attribute #17

Open
apachelogger opened this issue Jun 9, 2017 · 2 comments
Open

XMLRPC::Server port attribute #17

apachelogger opened this issue Jun 9, 2017 · 2 comments

Comments

@apachelogger
Copy link

@apachelogger apachelogger commented Jun 9, 2017

Right now Server doesn't really support port=0.
To WEBrick port=0 indicates that it should pick a port automatically. This still works with XMLRPC::Server as the argument is simply passed along. Currently there is no way to get the automatically determined port though. So, you can tell the server to pick a port but then you don't know which port it picked 🙄
It would be lovely if Server could get a simple forwarded attribute to either read webrick's config[:Port] or to config as a whole.

For unit testing purposes I do not care about the actual port used, I do however care that this port is dynamically picked so it doesn't conflict with concurrently running tests and/or other services.

s = XMLRPC::Server.new(0)
port = s.port # @server.config.fetch(:Port)
url = "http://localhost:#{port}"
test_handlers(url)
@herwinw
Copy link

@herwinw herwinw commented Jun 13, 2017

Something like #18 ?

@apachelogger
Copy link
Author

@apachelogger apachelogger commented Jun 21, 2017

Sorry, forgot to reply. That's exactly what I meant 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.