
Thank Dean! I am using this code: void threadSocket(tcp::socket *socket) { string msg = "Hello From Thread!"; boost::system::error_code ignored_error; boost::asio::write(*socket, boost::asio::buffer(msg), boost::asio::transfer_all(), ignored_error); std::this_thread::sleep_for(std::chrono::seconds(25)); } int main() { try { while(1) { boost::asio::io_service io_service; tcp::acceptor acceptor(io_service,tcp::endpoint(tcp::v4(),3211)); tcp::socket socket(io_service); cout << "Wait for connection." << std::endl; acceptor.accept(socket); std::thread t(bind(threadSocket,&socket)); t.join(); }//endwhile } catch(std::exception &e) { cout << e.what() <<endl; } return 0; } Can be correct? I have some problems with join() my thread... -- View this message in context: http://boost.2283326.n4.nabble.com/Boost-asio-question-tp3255518p3259214.htm... Sent from the Boost - Users mailing list archive at Nabble.com.