support definition of local endpoint for cleartext client session#1204
support definition of local endpoint for cleartext client session#1204akonskarm wants to merge 1 commit intonghttp2:masterfrom akonskarm:master
Conversation
| boost::asio::io_service &io_service, const boost::asio::ip::tcp::endpoint &local_endpoint, | ||
| const std::string &host, const std::string &service, | ||
| const boost::posix_time::time_duration &connect_timeout) | ||
| : session_impl(io_service, connect_timeout), socket_(io_service) {} |
There was a problem hiding this comment.
It looks like local_endpoint is not used.
|
Hi Tatsuhiro. Sorry for my mistake, I force-pushed the fix. Let me know if it's alright now. Best |
| const std::string &host, const std::string &service) | ||
| : impl_(std::make_shared<session_tcp_impl>( | ||
| io_service, host, service, boost::posix_time::seconds(60))) { | ||
| impl_->start_resolve(host, service); |
There was a problem hiding this comment.
local_endpoint is still not used. Should I assume that you just added session_tcp_impl::session_tcp_impl ctor which takes local_endpont and didn't fully implement it so that it can be used by public interface?
There was a problem hiding this comment.
Tatsuhiro, thanks for your patience. I keep doing the merge wrong.
Best
A.
|
I hope the merge was correct now Best |
| self->connected(endpoint_it); | ||
| }); | ||
| self->connected(endpoint_it); | ||
| }); |
There was a problem hiding this comment.
Are these changes necessary? It looks like nothing to do with local endpoint.
|
Hi Tatsuhiro Fixed the whitespace. Best |
| [self](const boost::system::error_code &ec, | ||
| tcp::resolver::iterator endpoint_it) { | ||
| socket_.async_connect(*endpoint_it, | ||
| [self,endpoint_it](const boost::system::error_code& ec) { |
There was a problem hiding this comment.
Why do you change this line? Doesn't boost::asio::async_connect work for you?
There was a problem hiding this comment.
Hi Tatsuhiro
The issue with boost::asio::async_connect is that it's going to close and reopen the connection, so the local ip will be unbound.
Please check this thread: https://stackoverflow.com/questions/20890703/how-to-use-a-specfic-networkinterface-ip-with-boost-asio-sockets
Best
A.
|
Cherry-picked as 7e06ac1 |
No description provided.