try
               {
                       while(  mWrapped->mSocket.in_avail() > 0 )
                       { ...

but I found that there is no in_avail() method exist in current version.  how can I  resolve the problem ?
in_avail is a method of buffered_stream,
tcp::socket has available()