Instead of using tie(), set the ios_base::unitbuf flag to force the stream to be flushed after every insertion.

This commit is contained in:
Christopher Kohlhoff 2012-07-24 09:35:36 +10:00
parent 1afef34c9a
commit 854d019a58

View File

@ -53,7 +53,7 @@
basic_socket_streambuf<Protocol, StreamSocketService, \ basic_socket_streambuf<Protocol, StreamSocketService, \
Time, TimeTraits, TimerService> >::member) \ Time, TimeTraits, TimerService> >::member) \
{ \ { \
tie(this); \ this->setf(std::ios_base::unitbuf); \
if (rdbuf()->connect(BOOST_PP_ENUM_PARAMS(n, x)) == 0) \ if (rdbuf()->connect(BOOST_PP_ENUM_PARAMS(n, x)) == 0) \
this->setstate(std::ios_base::failbit); \ this->setstate(std::ios_base::failbit); \
} \ } \
@ -111,7 +111,7 @@ public:
basic_socket_streambuf<Protocol, StreamSocketService, basic_socket_streambuf<Protocol, StreamSocketService,
Time, TimeTraits, TimerService> >::member) Time, TimeTraits, TimerService> >::member)
{ {
tie(this); this->setf(std::ios_base::unitbuf);
} }
#if defined(GENERATING_DOCUMENTATION) #if defined(GENERATING_DOCUMENTATION)
@ -130,7 +130,7 @@ public:
basic_socket_streambuf<Protocol, StreamSocketService, basic_socket_streambuf<Protocol, StreamSocketService,
Time, TimeTraits, TimerService> >::member) Time, TimeTraits, TimerService> >::member)
{ {
tie(this); this->setf(std::ios_base::unitbuf);
if (rdbuf()->connect(x...) == 0) if (rdbuf()->connect(x...) == 0)
this->setstate(std::ios_base::failbit); this->setstate(std::ios_base::failbit);
} }