diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 1997-03-24 20:25:22 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 1997-03-24 20:25:22 +0000 |
commit | ec3c7cb50e81bfced20a1927bbd083e46201d579 (patch) | |
tree | 9ba7c21c3d6eac08cd2e0798c107ebe88594f9cb /ace/SOCK_Dgram.cpp | |
parent | c0d1e515bb6af9e594f99cb9d6ae5a2fed067e84 (diff) | |
download | ATCD-ec3c7cb50e81bfced20a1927bbd083e46201d579.tar.gz |
gra
Diffstat (limited to 'ace/SOCK_Dgram.cpp')
-rw-r--r-- | ace/SOCK_Dgram.cpp | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/ace/SOCK_Dgram.cpp b/ace/SOCK_Dgram.cpp index df84064e61d..74bd75a20d9 100644 --- a/ace/SOCK_Dgram.cpp +++ b/ace/SOCK_Dgram.cpp @@ -1,7 +1,6 @@ // SOCK_Dgram.cpp // $Id$ - #define ACE_BUILD_DLL #include "ace/SOCK_Dgram.h" #include "ace/Synch.h" @@ -47,10 +46,10 @@ ACE_SOCK_Dgram::recv (iovec *io_vec, ACE_Addr &addr, int flags) const else return 0; #else - flags = flags; - addr = addr; - io_vec = io_vec; - ACE_NOTSUP_RETURN (-1); + ACE_UNUSED_ARG (flags); + ACE_UNUSED_ARG (addr); + ACE_UNUSED_ARG (io_vec); + ACE_NOTSUP_RETURN (-1); #endif /* FIONREAD */ } @@ -90,6 +89,7 @@ ACE_SOCK_Dgram::ACE_SOCK_Dgram (const ACE_Addr &local, : ACE_SOCK (SOCK_DGRAM, protocol_family, protocol, reuse_addr) { ACE_TRACE ("ACE_SOCK_Dgram::ACE_SOCK_Dgram"); + if (this->shared_open (local, protocol_family) == -1) ACE_ERROR ((LM_ERROR, "%p\n", "ACE_SOCK_Dgram")); } @@ -244,11 +244,16 @@ ACE_SOCK_Dgram::recv (iovec iov[], if (length != -1) { char *ptr = buf; - - for (i = 0; i < n; i++) + int copyn = length; + + for (i = 0; + i < n && copyn > 0; + i++) { - ACE_OS::memcpy (iov[i].iov_base, ptr, iov[i].iov_len); + ACE_OS::memcpy (iov[i].iov_base, ptr, + copyn > iov[i].iov_len ? iov[i].iov_len : copyn); ptr += iov[i].iov_len; + copyn -= iov[i].iov_len; } } |