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

Would you integrate this cadabra2 patch: get_acceptor() #560

Closed
yurivict opened this issue Jun 23, 2016 · 4 comments
Closed

Would you integrate this cadabra2 patch: get_acceptor() #560

yurivict opened this issue Jun 23, 2016 · 4 comments

Comments

@yurivict
Copy link

Cadabra project bundled websocketpp-0.6.0 with the only difference being an addition of get_acceptor() method: https://github.com/kpeeters/cadabra2/blob/master/client_server/websocketpp/transport/asio/endpoint.hpp

They use it to obtain the endpoint port:

                auto p = wserver.get_acceptor()->local_endpoint();
                std::cout << p.port()  << std::endl;

Would you think this is a good patch, and would you integrate it? Or what is the right way to do what cadabra2 is doing?

Thanks!

@zaphoyd
Copy link
Owner

zaphoyd commented Oct 3, 2016

The correct replacement for this would be to use endpoint::get_local_endpoint (https://docs.websocketpp.org/singletonwebsocketpp_1_1transport_1_1asio_1_1endpoint.html#a4147ba098fc2f1669d2f880b47917342 )

Example:

auto p = wserver.get_local_endpoint();
std::cout << p.port() << std::endl;

No changes to the library core would be needed. Note: this method was first available in 0.7.0 so the currently bundled 0.6.0 would need to be upgraded first (I would recommend doing so).

@kpeeters
Copy link

kpeeters commented Oct 8, 2016

I have upgraded to 0.7.0. As explained earlier, I do not want to unbundle, as that leads to dependency hell on OS X and several Linux distributions that do not have websocketpp (or do not have the right version).

@yurivict
Copy link
Author

yurivict commented Oct 8, 2016

Ok, thanks!

@yurivict
Copy link
Author

yurivict commented Oct 8, 2016

@kpeeters Please consider taking advantage of git submodule feature to bundle websocketpp: https://git-scm.com/docs/git-submodule

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants