Discussion:
Quick and Easy answerable question
(too old to reply)
Jim Sager
2017-04-24 21:07:53 UTC
Permalink
Hello,

I'm using the code from blocking_tcp_echo_client.

asio::read(s,asio::buffer(reply,request_length);

Only reads data until request_length is gotten.
In most other tcp socket programs I've used, it reads packets steadily as they come.
Is there a way to do this with asio? Or should I change my network protcol to send lengths of strings being sent?

I could imagine every read involves reading the packet length in a five digit long packet, then the actual packet.

,Goodnewsjimdotcom

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
asio-users mailing list
asio-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/asio-users
_______________________________________________
Using Asio? List your project at
http://think-async.com/Asio/WhoIsUsingAsio

Loading...