summaryrefslogtreecommitdiff
path: root/ace/SOCK_Dgram.cpp
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>1997-05-09 04:55:56 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>1997-05-09 04:55:56 +0000
commitaddafc86107ca1e642c1ed1f2b634aabbae1558c (patch)
treeb32bf9d335bfb489169ff4e48a944d481cb11775 /ace/SOCK_Dgram.cpp
parent1caed6b960388384e58af42f411f48dc429340fe (diff)
downloadATCD-addafc86107ca1e642c1ed1f2b634aabbae1558c.tar.gz
*** empty log message ***
Diffstat (limited to 'ace/SOCK_Dgram.cpp')
-rw-r--r--ace/SOCK_Dgram.cpp29
1 files changed, 27 insertions, 2 deletions
diff --git a/ace/SOCK_Dgram.cpp b/ace/SOCK_Dgram.cpp
index e9728166838..2f88d9b8cfa 100644
--- a/ace/SOCK_Dgram.cpp
+++ b/ace/SOCK_Dgram.cpp
@@ -19,7 +19,9 @@ ACE_SOCK_Dgram::dump (void) const
// returns the number of bytes read.
ssize_t
-ACE_SOCK_Dgram::recv (iovec *io_vec, ACE_Addr &addr, int flags) const
+ACE_SOCK_Dgram::recv (iovec *io_vec,
+ ACE_Addr &addr,
+ int flags) const
{
ACE_TRACE ("ACE_SOCK_Dgram::recv");
#if defined (FIONREAD)
@@ -59,7 +61,8 @@ ACE_SOCK_Dgram::recv (iovec *io_vec, ACE_Addr &addr, int flags) const
// to a portnumber.
int
-ACE_SOCK_Dgram::shared_open (const ACE_Addr &local, int protocol_family)
+ACE_SOCK_Dgram::shared_open (const ACE_Addr &local,
+ int protocol_family)
{
ACE_TRACE ("ACE_SOCK_Dgram::shared_open");
int error = 0;
@@ -281,3 +284,25 @@ ACE_SOCK_Dgram::recv (iovec iov[],
}
#endif /* ACE_HAS_MSG */
+
+ssize_t
+ACE_SOCK_Dgram::recv (void *buf,
+ size_t n,
+ ACE_Addr &addr,
+ int flags,
+ const ACE_Time_Value *timeout) const
+{
+ ACE_Handle_Set handle_set;
+ handle_set.reset ();
+ handle_set.set_bit (this->get_handle ());
+
+ // Check the status of the current socket.
+ int result = ACE_OS::select (int (this->get_handle ()) + 1,
+ handle_set,
+ 0, 0,
+ timeout);
+ if (result <= 0) // Other error or timeout.
+ return result;
+ else // Goes fine, call <recv> to get data
+ return this->recv (buf, n, addr, flags);
+}