In my code I have both a client and server socket set up to simulate interaction between the two using asio. Unfortunately, something is failing in my read() and I'm not entirely sure what I'm not passing in properly and why. When I run it, it'll wait indefinitely. Might it be something I'm missing?
boost::asio::io_service ioservice;
tcp::acceptor acceptor(ioservice);
tcp::socket client(ioservice);
tcp::socket server(ioservice);
boost::asio::ip::tcp::endpoint endpoint(boost::asio::ip::address::from_string("127.0.0.1"), 2222);
acceptor.open(endpoint.protocol());
acceptor.bind(endpoint);
acceptor.listen();
acceptor.async_accept(server, &acc_handle);
client.async_connect(endpoint, &conn_handle);
ioservice.run();
boost::asio::write(client, boost::asio::buffer("test"));
boost::asio::streambuf bfr;
boost::asio::read(client, bfr);
EDIT: Added handlers, they just log information so I'm omitting their definition.