22 Sep
2009
22 Sep
'09
8:16 p.m.
boost::asio::read(serverSocket, boost::asio::buffer((char *) message, messageSize)); <...> As you can see, the server does nothing with the client connection. However, the client reads the 12 bytes as requested in the last line with boost::asio::read. The information received here is junk (to my program) and causes it to crash.
Are you sure read() returns successfully and doesn't raise exception? Try to initialize the memory buffer (fill with zeros or something), and see if it really changes.