diff options
author | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-10-23 04:30:06 +0000 |
---|---|---|
committer | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-10-23 04:30:06 +0000 |
commit | 615c6979c0b339c7e2c89477899d63bf87e1dd93 (patch) | |
tree | 7e633c5be1c568b2e00f6ec8a2b6b3e6dbf3bd58 /ace/FILE_IO.cpp | |
parent | 34cd7dceb74cbcc62c09c388504bec353bed4881 (diff) | |
download | ATCD-TAO-0_2_32.tar.gz |
This commit was manufactured by cvs2svn to create tag 'TAO-0_2_32'.TAO-0_2_32
Diffstat (limited to 'ace/FILE_IO.cpp')
-rw-r--r-- | ace/FILE_IO.cpp | 130 |
1 files changed, 0 insertions, 130 deletions
diff --git a/ace/FILE_IO.cpp b/ace/FILE_IO.cpp deleted file mode 100644 index a13a9f624dd..00000000000 --- a/ace/FILE_IO.cpp +++ /dev/null @@ -1,130 +0,0 @@ -// FILE_IO.cpp -// $Id$ - -#define ACE_BUILD_DLL -#include "ace/FILE_IO.h" - -#if defined (ACE_LACKS_INLINE_FUNCTIONS) -#include "ace/FILE_IO.i" -#endif - -ACE_RCSID(ace, FILE_IO, "$Id$") - -ACE_ALLOC_HOOK_DEFINE(ACE_FILE_IO) - -void -ACE_FILE_IO::dump (void) const -{ - ACE_TRACE ("ACE_FILE_IO::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - this->addr_.dump (); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} - -// Simple-minded do nothing constructor. - -ACE_FILE_IO::ACE_FILE_IO (void) -{ - ACE_TRACE ("ACE_FILE_IO::ACE_FILE_IO"); -} - -// Send N char *ptrs and int lengths. Note that the char *'s precede -// the ints (basically, an varargs version of writev). The count N is -// the *total* number of trailing arguments, *not* a couple of the -// number of tuple pairs! - -ssize_t -ACE_FILE_IO::send (size_t n, ...) const -{ - ACE_TRACE ("ACE_FILE_IO::send"); - va_list argp; - size_t total_tuples = n / 2; - iovec *iovp; -#if defined (ACE_HAS_ALLOCA) - iovp = (iovec *) alloca (total_tuples * sizeof (iovec)); -#else - ACE_NEW_RETURN (iovp, iovec[total_tuples], -1); -#endif /* !defined (ACE_HAS_ALLOCA) */ - - va_start (argp, n); - - for (size_t i = 0; i < total_tuples; i++) - { - iovp[i].iov_base = va_arg (argp, char *); - iovp[i].iov_len = va_arg (argp, int); - } - - ssize_t result = ACE_OS::writev (this->get_handle (), iovp, total_tuples); -#if !defined (ACE_HAS_ALLOCA) - delete [] iovp; -#endif /* !defined (ACE_HAS_ALLOCA) */ - va_end (argp); - return result; -} - -// This is basically an interface to ACE_OS::readv, that doesn't use -// the struct iovec explicitly. The ... can be passed as an arbitrary -// number of (char *ptr, int len) tuples. However, the count N is the -// *total* number of trailing arguments, *not* a couple of the number -// of tuple pairs! - -ssize_t -ACE_FILE_IO::recv (size_t n, ...) const -{ - ACE_TRACE ("ACE_FILE_IO::recv"); - va_list argp; - size_t total_tuples = n / 2; - iovec *iovp; -#if defined (ACE_HAS_ALLOCA) - iovp = (iovec *) alloca (total_tuples * sizeof (iovec)); -#else - ACE_NEW_RETURN (iovp, iovec[total_tuples], -1); -#endif /* !defined (ACE_HAS_ALLOCA) */ - - va_start (argp, n); - - for (size_t i = 0; i < total_tuples; i++) - { - iovp[i].iov_base = va_arg (argp, char *); - iovp[i].iov_len = va_arg (argp, int); - } - - ssize_t result = ACE_OS::readv (this->get_handle (), iovp, total_tuples); -#if !defined (ACE_HAS_ALLOCA) - delete [] iovp; -#endif /* !defined (ACE_HAS_ALLOCA) */ - va_end (argp); - return result; -} - -// Return the local endpoint address. - -int -ACE_FILE_IO::get_local_addr (ACE_Addr &addr) const -{ - ACE_TRACE ("ACE_FILE_IO::get_local_addr"); - - // Perform the downcast since <addr> had better be an - // <ACE_FILE_Addr>. - ACE_FILE_Addr *file_addr = ACE_dynamic_cast (ACE_FILE_Addr *, &addr); - - if (file_addr == 0) - return -1; - else - { - *file_addr = this->addr_; - return 0; - } -} - -// Return the address of the remotely connected peer (if there is -// one). - -int -ACE_FILE_IO::get_remote_addr (ACE_Addr &addr) const -{ - ACE_TRACE ("ACE_FILE_IO::get_remote_addr"); - - return this->get_local_addr (addr); -} |