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.cpp | |
parent | 6a2ca6652a2a28c1670d786f7f7f13abec3655aa (diff) | |
download | ATCD-092f3e078566f541e977a4ca7310c84e13f65eab.tar.gz |
Incoporate James CE Johnson's patches.
Diffstat (limited to 'ace/IOStream.cpp')
-rw-r--r-- | ace/IOStream.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/ace/IOStream.cpp b/ace/IOStream.cpp index 42187b95422..6b9286d9cea 100644 --- a/ace/IOStream.cpp +++ b/ace/IOStream.cpp @@ -392,6 +392,8 @@ ACE_Streambuf::flushbuf (void) int ACE_Streambuf::get_one_byte (void) { + this->timeout_ = 0; + // The recv function will return immediately if there is no data // waiting. So, we use recv_n to wait for exactly one byte to come // from the peer. Later, we can use recv to see if there is @@ -399,7 +401,11 @@ ACE_Streambuf::get_one_byte (void) // to block but I like this better.) if (this->recv_n (base (), 1, MSG_PEEK, recv_timeout_) != 1) - return EOF; + { + if (errno == ETIME) + this->timeout_ = 1; + return EOF; + } else return 1; } @@ -426,7 +432,11 @@ ACE_Streambuf::fillbuf (void) // error. if (bc < 0) - return EOF; + { + if (errno == ETIME) + this->timeout_ = 1; + return EOF; + } // Move the get pointer to reflect the number of bytes we just read. @@ -609,5 +619,12 @@ ACE_Streambuf::~ACE_Streambuf (void) delete [] this->pbase_saved_; } +u_char ACE_Streambuf::timeout (void) +{ + u_char rval = this->timeout_; + time->timeout_ = 0; + return rval; +} + #endif /* !ACE_LACKS_ACE_IOSTREAM */ #endif /* ACE_IOSTREAM_C */ |