diff --git a/include/fc/asio.hpp b/include/fc/asio.hpp index 3ad05b2..a2a0fb7 100644 --- a/include/fc/asio.hpp +++ b/include/fc/asio.hpp @@ -19,7 +19,6 @@ namespace asio { * @brief internal implementation types/methods for fc::asio */ namespace detail { - using namespace fc; class read_write_handler { @@ -59,14 +58,14 @@ namespace asio { bool operator()( C& c, bool s ) { c.non_blocking(s); return true; } }; - #if WIN32 // windows stream handles do not support non blocking! +#if WIN32 // windows stream handles do not support non blocking! template<> struct non_blocking { typedef boost::asio::windows::stream_handle C; bool operator()( C& ) { return false; } bool operator()( C&, bool ) { return false; } }; - #endif +#endif } // end of namespace detail /*** diff --git a/src/asio.cpp b/src/asio.cpp index 909f4a5..cec7de6 100644 --- a/src/asio.cpp +++ b/src/asio.cpp @@ -58,7 +58,6 @@ namespace fc { } else { - //elog( "${message} ", ("message", boost::system::system_error(ec).what())); p->set_exception( fc::exception_ptr( new fc::exception( FC_LOG_MESSAGE( error, "${message} ", ("message", boost::system::system_error(ec).what())) ) ) ); } @@ -83,8 +82,6 @@ namespace fc { } p->set_value( eps ); } else { - //elog( "%s", boost::system::system_error(ec).what() ); - //p->set_exception( fc::copy_exception( boost::system::system_error(ec) ) ); p->set_exception( fc::exception_ptr( new fc::exception( FC_LOG_MESSAGE( error, "process exited with: ${message} ", @@ -125,9 +122,9 @@ namespace fc { for( uint16_t i = 0; i < this->num_io_threads; ++i ) { - asio_threads.push_back( new boost::thread( [=]() + asio_threads.push_back( new boost::thread( [i,this]() { - fc::thread::current().set_name("asio"); + fc::thread::current().set_name( "fc::asio worker #" + fc::to_string(i) ); BOOST_SCOPE_EXIT(void) { @@ -194,7 +191,7 @@ namespace fc { promise >::ptr p( new promise >("tcp::resolve completion") ); res.async_resolve( boost::asio::ip::tcp::resolver::query(hostname,port), boost::bind( detail::resolve_handler, p, _1, _2 ) ); - return p->wait();; + return p->wait(); } FC_RETHROW_EXCEPTIONS(warn, "") }