
boost::asio::async_write(*_socket, buffers, boost::bind(&DJClient::handle_write, this, boost::asio::placeholders::error)); For the above code, handle_write is never called. I can see on the server side that the server has received the request and has also sent the response. But I do not receive the response in the client side. It seems something is going wrong with io_service
If the handlers are not invoked, your io_serivce probably isn't running. Try to add a log message after io_service::run() call, so that you'll see when it exits. If your design needs io_service restart, don't forget to call io_servie::reset() before any subsequent run(). If you see that the io_service::run() doesn't exit, then maybe one of the handlers blocks the io_service queue (eg., due to some mutex lock or something like that).