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

get_io_context() deprecation makes ssl::stream construction from moved socket impossible #252

Closed
vinniefalco opened this issue Sep 10, 2017 · 2 comments

Comments

@vinniefalco
Copy link

vinniefalco commented Sep 10, 2017

The following behavior cannot be implemented without using deprecated interfaces:

void make_stream(asio::ip::tcp::socket sock, asio::ssl::context& ctx)
{
    asio::ssl::stream<asio::ip::tcp::socket> ss{sock.get_io_context(), ctx};
    ss.next_layer() = std::move(sock);

    ...
@vinniefalco vinniefalco changed the title get_io_context() deprecation makes ssl::stream construction impossible get_io_context() deprecation makes ssl::stream construction from moved socket impossible Sep 10, 2017
@vinniefalco
Copy link
Author

This is a specific case of a general problem. You can't construct a new socket that uses the io_context of an existing socket without calling get_io_context, which is deprecated. And there is no socket constructor which accepts an io_context::executor_type.

@vinniefalco
Copy link
Author

Hmm... get_executor().context() seems to work in place of get_io_service().

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

No branches or pull requests

1 participant