diff options
author | nw1 <nw1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-12-19 23:22:39 +0000 |
---|---|---|
committer | nw1 <nw1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-12-19 23:22:39 +0000 |
commit | 092f3e078566f541e977a4ca7310c84e13f65eab (patch) | |
tree | 736b8d60a60b6ee3a9971e9a19670013d7cfff19 /ace/IOStream_T.i | |
parent | 6a2ca6652a2a28c1670d786f7f7f13abec3655aa (diff) | |
download | ATCD-092f3e078566f541e977a4ca7310c84e13f65eab.tar.gz |
Incoporate James CE Johnson's patches.
Diffstat (limited to 'ace/IOStream_T.i')
-rw-r--r-- | ace/IOStream_T.i | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/ace/IOStream_T.i b/ace/IOStream_T.i index e97583cafc7..49ee5a19d28 100644 --- a/ace/IOStream_T.i +++ b/ace/IOStream_T.i @@ -43,11 +43,23 @@ ACE_Streambuf_T<STREAM>::get_handle (void) template <class STREAM> ACE_INLINE int ACE_IOStream<STREAM>::eof (void) const { +// char c; +// return ACE_OS::recv (this->get_handle (), +// &c, +// sizeof c, +// MSG_PEEK) <= 0; + // Get the timeout value of the streambuf + ACE_Time_Value * timeout = this->streambuf_->recv_timeout(0); + + // Reset the timeout value of the streambuf + (void)this->streambuf_->recv_timeout(timeout); + char c; - return ACE_OS::recv (this->get_handle (), - &c, - sizeof c, - MSG_PEEK) <= 0; + int rval = this->streambuf_->recv_n( &c, sizeof c, MSG_PEEK, timeout ); + + // If recv_n() didn't fail or failed because of timeout we're + // not at EOF. + return rval != -1 && ! this->streambuf_->timeout(); } |