close
Skip to content

XMLRPC::Server port attribute #17

@hsitter

Description

@hsitter

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions