diff options
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, |