diff options
author | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2002-05-02 05:33:17 +0000 |
---|---|---|
committer | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2002-05-02 05:33:17 +0000 |
commit | 9f9968b216d8a5ba4a4015de4bbc71357388ff75 (patch) | |
tree | 338b7e4bce26a151ba76bc69293751bfe544c706 /ace/TLI_Stream.cpp | |
parent | 4da55c6175ddeb43ea7f9b56f3a313cdb65b6312 (diff) | |
download | ATCD-9f9968b216d8a5ba4a4015de4bbc71357388ff75.tar.gz |
ChangeLogTag: Thu May 2 00:29:34 2002 Irfan Pyarali <irfan@cs.wustl.edu>
Diffstat (limited to 'ace/TLI_Stream.cpp')
-rw-r--r-- | ace/TLI_Stream.cpp | 144 |
1 files changed, 132 insertions, 12 deletions
diff --git a/ace/TLI_Stream.cpp b/ace/TLI_Stream.cpp index a5533d40492..4a216137ea5 100644 --- a/ace/TLI_Stream.cpp +++ b/ace/TLI_Stream.cpp @@ -4,6 +4,7 @@ abstraction. */ #include "ace/TLI_Stream.h" +#include "ace/ACE.h" ACE_RCSID(ace, TLI_Stream, "$Id$") @@ -37,7 +38,7 @@ ACE_TLI_Stream::get_remote_addr (ACE_Addr &sa) const name.maxlen = sa.get_size (); name.buf = (char *) sa.get_addr (); - // if (ACE_OS::t_getname (this->get_handle (), &name, REMOTENAME) == -1) + // if (ACE_OS::t_getname (this->get_handle (), &name, REMOTENAME) == -1) if (ACE_OS::ioctl (this->get_handle (), TI_GETPEERNAME, &name) == -1) @@ -58,17 +59,17 @@ ACE_TLI_Stream::active_close (void) ACE_TRACE ("ACE_TLI_Stream::active_close"); char buf; - if (this->sndrel () == -1) - return -1; - else if (this->recv (&buf, sizeof buf) == -1) + if (this->sndrel () == -1) + return -1; + else if (this->recv (&buf, sizeof buf) == -1) { if (t_errno == TLOOK && this->look () == T_ORDREL) { - if (this->rcvrel () == -1) - return -1; + if (this->rcvrel () == -1) + return -1; } else - return -1; + return -1; } return this->close (); @@ -82,10 +83,10 @@ ACE_TLI_Stream::passive_close (void) { ACE_TRACE ("ACE_TLI_Stream::passive_close"); - if (this->rcvrel () == -1) - return -1; - else if (this->sndrel () == -1) - return -1; + if (this->rcvrel () == -1) + return -1; + else if (this->sndrel () == -1) + return -1; return this->close (); } @@ -95,7 +96,7 @@ ACE_TLI_Stream::close (void) { ACE_TRACE ("ACE_TLI_Stream::close"); - ACE_HANDLE fd = this->get_handle (); + ACE_HANDLE fd = this->get_handle (); this->set_handle (ACE_INVALID_HANDLE); @@ -107,4 +108,123 @@ ACE_TLI_Stream::close (void) return ACE_OS::t_close (fd); } +ssize_t +ACE_TLI_Stream::send (const void *buf, + size_t n, + const ACE_Time_Value *timeout) const +{ + ACE_TRACE ("ACE_TLI_Stream::send"); + return ACE::send (this->get_handle (), + buf, + n, + timeout); +} + +ssize_t +ACE_TLI_Stream::send (const void *buf, + size_t n, + int flags, + const ACE_Time_Value *timeout) const +{ + ACE_TRACE ("ACE_TLI_Stream::send"); + return ACE::t_snd (this->get_handle (), + buf, + n, + flags, + timeout); +} + +ssize_t +ACE_TLI_Stream::recv (void *buf, + size_t n, + const ACE_Time_Value *timeout) const +{ + ACE_TRACE ("ACE_TLI_Stream::recv"); + return ACE::recv (this->get_handle (), + buf, + n, + timeout); +} + +ssize_t +ACE_TLI_Stream::recv (void *buf, + size_t n, + int *flags, + const ACE_Time_Value *timeout) const +{ + ACE_TRACE ("ACE_TLI_Stream::recv"); + int f = 0; + + if (flags == 0) + flags = &f; + + return ACE::t_rcv (this->get_handle (), + buf, + n, + flags, + timeout); +} + +ssize_t +ACE_TLI_Stream::send_n (const void *buf, + size_t n, + const ACE_Time_Value *timeout, + size_t *bytes_transferred) const +{ + ACE_TRACE ("ACE_TLI_Stream::send_n"); + return ACE::send_n (this->get_handle (), + buf, + n, + timeout, + bytes_transferred); +} + +ssize_t +ACE_TLI_Stream::send_n (const void *buf, + size_t n, + int flags, + const ACE_Time_Value *timeout, + size_t *bytes_transferred) const +{ + ACE_TRACE ("ACE_TLI_Stream::send_n"); + + return ACE::t_snd_n (this->get_handle (), + buf, + n, + flags, + timeout, + bytes_transferred); +} + +ssize_t +ACE_TLI_Stream::recv_n (void *buf, + size_t n, + const ACE_Time_Value *timeout, + size_t *bytes_transferred) const +{ + ACE_TRACE ("ACE_TLI_Stream::recv_n"); + return ACE::recv_n (this->get_handle (), + buf, + n, + timeout, + bytes_transferred); +} + +ssize_t +ACE_TLI_Stream::recv_n (void *buf, + size_t n, + int *flags, + const ACE_Time_Value *timeout, + size_t *bytes_transferred) const +{ + ACE_TRACE ("ACE_TLI_Stream::recv_n"); + + return ACE::t_rcv_n (this->get_handle (), + buf, + n, + flags, + timeout, + bytes_transferred); +} + #endif /* ACE_HAS_TLI */ |