Boost Users :
Subject: Re: [Boost-users] [asio] sync receive_from with timeout
From: Stephan Menzel (stephan.menzel_at_[hidden])
Date: 2009-03-04 11:05:16
> boost::system::error_code ec;
> boost::asio::socket_base::non_blocking_io command(true);
> bytesRead = _socket->read_some(boost::asio::buffer(data,
> dataBufferSize), ec);
> //there is some other error the client has disconnected;
> //I must have got some data or theres no data yet check
> bytesRead for that
> No extra threads necessary.
Indeed. But the way I see it, you gotta be aware that each of you reads will take at least 100 mils, right? In my scenario this is not really affordable.
Or am I missing something here? The first read will never have something ready in a reliable way, right? Nice try though...
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net