diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 1999-01-15 21:15:03 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 1999-01-15 21:15:03 +0000 |
commit | f3a5de42f2671b499f321aa0a99441ef3bb8a6d1 (patch) | |
tree | 6a1ebcacef03ee1905ba7f67ea14f08c01924101 /ace/SOCK_IO.cpp | |
parent | 386c693be398474259cd9123081ffd387a47635a (diff) | |
download | ATCD-f3a5de42f2671b499f321aa0a99441ef3bb8a6d1.tar.gz |
.
Diffstat (limited to 'ace/SOCK_IO.cpp')
-rw-r--r-- | ace/SOCK_IO.cpp | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/ace/SOCK_IO.cpp b/ace/SOCK_IO.cpp index 853d11f9ed7..7e592b4a92c 100644 --- a/ace/SOCK_IO.cpp +++ b/ace/SOCK_IO.cpp @@ -3,6 +3,7 @@ #define ACE_BUILD_DLL #include "ace/SOCK_IO.h" +#include "ace/Handle_Set.h" #if defined (ACE_LACKS_INLINE_FUNCTIONS) #include "ace/SOCK_IO.i" @@ -24,10 +25,33 @@ ACE_SOCK_IO::dump (void) const // returns the number of bytes read. ssize_t -ACE_SOCK_IO::recvv (iovec *io_vec) +ACE_SOCK_IO::recvv (iovec *io_vec, + const ACE_Time_Value *timeout) { ACE_TRACE ("ACE_SOCK_IO::recvv"); #if defined (FIONREAD) + ACE_Handle_Set handle_set; + handle_set.reset (); + handle_set.set_bit (this->get_handle ()); + + // Check the status of the current socket. + switch (ACE_OS::select (int (this->get_handle ()) + 1, + handle_set, + 0, 0, + timeout)) + { + case -1: + return -1; + /* NOTREACHED */ + case 0: + errno = ETIME; + return -1; + /* NOTREACHED */ + default: + // Goes fine, fallthrough to get data + break; + } + u_long inlen; if (ACE_OS::ioctl (this->get_handle (), FIONREAD, |