c++ - Boost Asio UDP Daytime Server Async receive -


i've been learning boost asio recently, udp. familiar basics, had question regarding how udp handles incoming messages. in tutorial (see source code here: http://www.boost.org/doc/libs/1_54_0/doc/html/boost_asio/tutorial/tutdaytime6/src.html), udp server operates (very pseudo-code):

startreceive(){     async_receive(boost::bind(handler),...other params); }  handler(){     dostufftodatareceived();     startreceive(); //start receiving process on again allow receive more data } 

my question is, if data arrives server during time in "dostufftodatareceived()", before startreceives on again, data lost, or sit there , wait startreceive happen again , retrieved?

thanks!

udp stack has buffer, data in above example wouldn't lost.

note however, udp allowed drop packets under various circumstances. so, throughput of udp server grows, timings of dostufftodatareceived might become more critical.


Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -