diff --git a/source/corvusoft/restbed/detail/socket_impl.cpp b/source/corvusoft/restbed/detail/socket_impl.cpp index f3687c36..a52dc4ee 100644 --- a/source/corvusoft/restbed/detail/socket_impl.cpp +++ b/source/corvusoft/restbed/detail/socket_impl.cpp @@ -412,7 +412,7 @@ namespace restbed { m_timer->cancel( ); m_timer->expires_from_now( m_timeout ); - m_timer->async_wait( bind( &SocketImpl::connection_timeout_handler, this, shared_from_this( ), _1 ) ); + m_timer->async_wait( m_strand->wrap( bind( &SocketImpl::connection_timeout_handler, this, shared_from_this( ), _1 ) ) ); size_t size = 0; auto finished = std::make_shared(false); @@ -461,7 +461,7 @@ namespace restbed { m_timer->cancel( ); m_timer->expires_from_now( m_timeout ); - m_timer->async_wait( bind( &SocketImpl::connection_timeout_handler, this, shared_from_this( ), _1 ) ); + m_timer->async_wait( m_strand->wrap( bind( &SocketImpl::connection_timeout_handler, this, shared_from_this( ), _1 ) ) ); #ifdef BUILD_SSL