asio: Fix bug that server event loop breaks with exception
This can happen when we call throwing version of basic_stream_socket::remote_endpoint() call while client disconnected.
This commit is contained in:
parent
e302cc9c16
commit
2d6211c455
|
@ -79,8 +79,10 @@ public:
|
|||
|
||||
/// Start the first asynchronous operation for the connection.
|
||||
void start() {
|
||||
boost::system::error_code ec;
|
||||
|
||||
handler_ = std::make_shared<http2_handler>(
|
||||
socket_.get_io_service(), socket_.lowest_layer().remote_endpoint(),
|
||||
socket_.get_io_service(), socket_.lowest_layer().remote_endpoint(ec),
|
||||
[this]() { do_write(); }, mux_);
|
||||
if (handler_->start() != 0) {
|
||||
stop();
|
||||
|
|
Loading…
Reference in New Issue