I have a server created using Boost.ASIO (thanks to sehe from Stackoverflow). The server is supposed to received message from client, parse it as json and correspondingly send the message back to client. To make life easier, i have considered very simple cases:
(i) Client can send {"hello":"client"}, server should send response {"hello":"server"}
(ii) Client can send {"message" : "Some Message"}, server should send {"response" : "OK"}

The server runs, accepts data from client but cannot call the handler of async_read. The doc states that
The asynchronous operation will continue until one of the following conditions is true:
1. The supplied buffers are full. That is, the bytes transferred is equal to the sum of the buffer sizes.
2. An error occurred.

I think in my case the buffer is not full, thus the handler function is not getting called. How should I change my code so that server can read the message sent by client, process it and send back correct response.?

PS: If the code is not attached, http://pastebin.com/pi192t6i is the link to file.

--
Sarvagya Pant
Kathmandu, Nepal
+9779803468257