41 lines
1.5 KiB
Diff
41 lines
1.5 KiB
Diff
<<<<<<<
|
|
template <typename config>
|
|
void connection<config>::handle_terminate(terminate_status tstat,
|
|
lib::error_code const & ec)
|
|
{
|
|
if (m_alog->static_test(log::alevel::devel)) {
|
|
m_alog->write(log::alevel::devel,"connection handle_terminate");
|
|
}
|
|
|
|
if (ec) {
|
|
// there was an error actually shutting down the connection
|
|
log_err(log::elevel::devel,"handle_terminate",ec);
|
|
}
|
|
=======
|
|
template <typename config>
|
|
void connection<config>::handle_terminate(terminate_status tstat,
|
|
lib::error_code const & ec)
|
|
{
|
|
if (m_alog->static_test(log::alevel::devel)) {
|
|
m_alog->write(log::alevel::devel,"connection handle_terminate");
|
|
}
|
|
|
|
if (ec) {
|
|
// there was an error actually shutting down the connection
|
|
log_err(log::elevel::devel,"handle_terminate",ec);
|
|
}
|
|
|
|
// Even with all workarounds and bug fixes in socket-io master branch, still running into
|
|
// cases like https://github.com/socketio/socket.io-client-cpp/issues/254.
|
|
//
|
|
// After much investigation and debugging, seems like the socket is remaining
|
|
// open and preventing the network thread from ending. Perhaps this is specific to the
|
|
// environment where this code is run by Solink. The only solution seems to be manually
|
|
// closing the socket as described here: https://github.com/zaphoyd/websocketpp/issues/805
|
|
|
|
bool isSocketOpen = transport_con_type::get_raw_socket().is_open();
|
|
if (isSocketOpen) {
|
|
transport_con_type::get_raw_socket().close();
|
|
}
|
|
>>>>>>>
|