Boost logo

Boost Users :

Subject: Re: [Boost-users] Too many EOF's using boost::asio
From: Lars Viklund (zao_at_[hidden])
Date: 2013-08-30 20:52:00


On Fri, Aug 30, 2013 at 11:25:39PM +0200, Jens Weller wrote:
> > Gesendet: Freitag, 30. August 2013 um 23:09 Uhr
> > Von: ustulation <ustulation_at_[hidden]>
> > An: boost-users_at_[hidden]
> > Betreff: [Boost-users] Too many EOF's using boost::asio
> >
> > //m_writeBuffer is boost::asio::streambuf..m_writeQueue is
> > std::deque<std::string>
> > m_writeBuffer.sputn(&m_writeQueue.at(0)[0], m_writeQueue.at(0).size());
>
> Hm. How big is your data? deque is not like vector giving you an array of elements.
> std::deque splits internally into differen chunks, maybe your problems come from this.
> I can't really see that using deque in this way would be safe.
> If your data is always smaller then the chunksize of deque,
> things are ok, other wise, well you're surely not getting what you expect.

His code is accessing the underlying storage of a std::string, that
happens to be in a deque, which is fine as long as you're not
invalidating the elements of the deque.

Anyway, this might be a manifestation of the 1.54.0 bug with
Boost.ASIO+IOCP having spurious EOFs on Windows:
https://svn.boost.org/trac/boost/ticket/8967

-- 
Lars Viklund | zao_at_[hidden]

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