-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Provide a way to access acceptor::local_endpoint #458
Comments
This would help us a lot in testing. For automated tests, you really want the OS to pick the port so that you avoid having to fail if a hardcoded port happens to be taken. Currently this is not possible with websocketpp, as there is no way to determine afterwards how to connect to a server. |
Pullrequest " API to expose TCP port #472 " deals with the clean way of exposing acceptor::local endpoint 's port .It is a handy API to retrieve the ephemeral port set by the OS .The client process can then dynamically connect using this port. @zaphoyd Please review it and suggest if some further changes are required. |
I've pushed a patch to the develop branch that adds a |
This feature was added. If any problems crop up in the future, go ahead and open a new issue. |
Example use case: When I start a server on port 0 the OS picks a free port for me as expected. However, there doesn't seem to be a way to find out which port it picked. This information is available in the asio acceptor but is not exposed in the endpoint. Would it be possible to expose it? The relevant method is acceptor::local_endpoint.
The text was updated successfully, but these errors were encountered: