#include <TLI_Stream.h>
Inheritance diagram for ACE_TLI_Stream:


Public Types | |
| typedef ACE_INET_Addr | PEER_ADDR | 
Public Member Functions | |
| ACE_TLI_Stream (void) | |
| Default constructor.   | |
| int | close (void) | 
| Close down and release resources.   | |
| int | active_close (void) | 
| Send a release and then await the release from the other side.   | |
| int | passive_close (void) | 
| int | get_remote_addr (ACE_Addr &) const | 
| Return address of remotely connected peer.   | |
| ssize_t | send (const void *buf, size_t n, int flags, const ACE_Time_Value *timeout=0) const | 
| Send an n byte buffer to the connected socket (uses t_snd(3)).   | |
| ssize_t | recv (void *buf, size_t n, int *flags, const ACE_Time_Value *timeout=0) const | 
| Recv an n byte buffer from the connected socket (uses t_rcv(3)).   | |
| ssize_t | send_n (const void *buf, size_t n, int flags, const ACE_Time_Value *timeout=0, size_t *bytes_transferred=0) const | 
| Send exactly n bytes to the connected socket (uses t_snd(3)).   | |
| ssize_t | recv_n (void *buf, size_t n, int *flags, const ACE_Time_Value *timeout=0, size_t *bytes_transferred=0) const | 
| Recv exactly n bytes from the connected socket (uses t_rcv(3)).   | |
| ssize_t | send (const void *buf, size_t n, const ACE_Time_Value *timeout=0) const | 
| Send an n byte buffer to the connected socket (uses write(2)).   | |
| ssize_t | recv (void *buf, size_t n, const ACE_Time_Value *timeout=0) const | 
| Recv an n byte buffer from the connected socket (uses read(2)).   | |
| ssize_t | send_n (const void *buf, size_t n, const ACE_Time_Value *timeout=0, size_t *bytes_transferred=0) const | 
| Send n bytes, keep trying until n are sent (uses write(2)).   | |
| ssize_t | recv_n (void *buf, size_t n, const ACE_Time_Value *timeout=0, size_t *bytes_transferred=0) const | 
| Recv n bytes, keep trying until n are received (uses read (2)).   | |
| void | dump (void) const | 
| Dump the state of an object.   | |
Public Attributes | |
| ACE_ALLOC_HOOK_DECLARE | |
| Declare the dynamic allocation hooks.   | |
Private Member Functions | |
| int | get_rwflag (void) const | 
| Get rwflag.   | |
| void | set_rwflag (int value) | 
| Set rwflag.   | |
Private Attributes | |
| int | rwflag_ | 
| Indicates whether the tirdwr module should be pushed.   | |
Friends | |
| class | ACE_TLI_Acceptor | 
| class | ACE_TLI_Connector | 
Definition at line 39 of file TLI_Stream.h.
      
  | 
  
| 
 
 Definition at line 114 of file TLI_Stream.h.  | 
  
      
  | 
  
| 
 Default constructor. 
 Definition at line 30 of file TLI_Stream.cpp. References ACE_TRACE. 
  | 
  
      
  | 
  
| 
 Send a release and then await the release from the other side. 
 Definition at line 54 of file TLI_Stream.cpp. References ACE_TRACE, close(), ACE_TLI::look(), ACE_TLI::rcvrel(), recv(), and ACE_TLI::sndrel(). 
 00055 {
00056   ACE_TRACE ("ACE_TLI_Stream::active_close");
00057   char buf;
00058 
00059   if (this->sndrel () == -1)
00060     return -1;
00061   else if (this->recv (&buf, sizeof buf) == -1)
00062     {
00063       if (t_errno == TLOOK && this->look () == T_ORDREL)
00064         {
00065           if (this->rcvrel () == -1)
00066             return -1;
00067         }
00068       else
00069         return -1;
00070     }
00071 
00072   return this->close ();
00073 }
 | 
  
      
  | 
  
| 
 Close down and release resources. 
 Reimplemented from ACE_TLI. Definition at line 92 of file TLI_Stream.cpp. References ACE_TRACE, ACE_OS::close(), ACE_IPC_SAP::get_handle(), ACE_IPC_SAP::set_handle(), and ACE_OS::t_close(). Referenced by active_close(), ACE_TLI_Connector::complete(), ACE_TLI_Connector::connect(), and passive_close(). 
 00093 {
00094   ACE_TRACE ("ACE_TLI_Stream::close");
00095 
00096   ACE_HANDLE fd = this->get_handle ();
00097 
00098   this->set_handle (ACE_INVALID_HANDLE);
00099 
00100 #if !defined (ACE_WIN32)
00101   if (this->rwflag_)
00102     return ACE_OS::close (fd);
00103   else
00104 #endif /* ACE_WIN32 */
00105     return ACE_OS::t_close (fd);
00106 }
 | 
  
      
  | 
  
| 
 Dump the state of an object. 
 Reimplemented from ACE_TLI. Definition at line 23 of file TLI_Stream.cpp. References ACE_TRACE. 
 00024 {
00025 #if defined (ACE_HAS_DUMP)
00026   ACE_TRACE ("ACE_TLI_Stream::dump");
00027 #endif /* ACE_HAS_DUMP */
00028 }
 | 
  
      
  | 
  
| 
 Return address of remotely connected peer. 
 Definition at line 37 of file TLI_Stream.cpp. References ACE_TRACE, ACE_Addr::get_addr(), ACE_Addr::get_size(), and ACE_OS::t_getname(). 
 00038 {
00039   ACE_TRACE ("ACE_TLI_Stream::get_remote_addr");
00040 
00041   struct netbuf name;
00042   name.maxlen = sa.get_size ();
00043   name.buf = (char *) sa.get_addr ();
00044 
00045   if (ACE_OS::t_getname (this->get_handle (), &name, REMOTENAME) == -1)
00046     return -1;
00047   else
00048     return 0;
00049 }
 | 
  
      
  | 
  
| 
 Get rwflag. 
 Definition at line 19 of file TLI_Stream.inl. References ACE_TRACE. Referenced by ACE_TLI_Connector::connect(). 
  | 
  
      
  | 
  
| 
 Acknowledge the release from the other side and then send the release to the other side. Definition at line 79 of file TLI_Stream.cpp. References ACE_TRACE, close(), ACE_TLI::rcvrel(), and ACE_TLI::sndrel(). 
  | 
  
      
  | 
  ||||||||||||||||
| 
 Recv an n byte buffer from the connected socket (uses read(2)). 
 Definition at line 135 of file TLI_Stream.cpp. References ACE_TRACE, and ACE::recv(). 
  | 
  
      
  | 
  ||||||||||||||||||||
| 
 Recv an n byte buffer from the connected socket (uses t_rcv(3)). 
 Definition at line 147 of file TLI_Stream.cpp. References ACE_TRACE, and ACE::t_rcv(). Referenced by active_close(). 
 00151 {
00152   ACE_TRACE ("ACE_TLI_Stream::recv");
00153   int f = 0;
00154 
00155   if (flags == 0)
00156     flags = &f;
00157 
00158   return ACE::t_rcv (this->get_handle (),
00159                      buf,
00160                      n,
00161                      flags,
00162                      timeout);
00163 }
 | 
  
      
  | 
  ||||||||||||||||||||
| 
 Recv n bytes, keep trying until n are received (uses read (2)). 
 Definition at line 197 of file TLI_Stream.cpp. References ACE_TRACE, and ACE::recv_n(). 
 00201 {
00202   ACE_TRACE ("ACE_TLI_Stream::recv_n");
00203   return ACE::recv_n (this->get_handle (),
00204                       buf,
00205                       n,
00206                       timeout,
00207                       bytes_transferred);
00208 }
 | 
  
      
  | 
  ||||||||||||||||||||||||
| 
 Recv exactly n bytes from the connected socket (uses t_rcv(3)). 
 Definition at line 211 of file TLI_Stream.cpp. References ACE_TRACE, and ACE::t_rcv_n(). 
 00216 {
00217   ACE_TRACE ("ACE_TLI_Stream::recv_n");
00218 
00219   return ACE::t_rcv_n (this->get_handle (),
00220                        buf,
00221                        n,
00222                        flags,
00223                        timeout,
00224                        bytes_transferred);
00225 }
 | 
  
      
  | 
  ||||||||||||||||
| 
 Send an n byte buffer to the connected socket (uses write(2)). 
 Definition at line 109 of file TLI_Stream.cpp. References ACE_TRACE, and ACE::send(). 
  | 
  
      
  | 
  ||||||||||||||||||||
| 
 Send an n byte buffer to the connected socket (uses t_snd(3)). 
 Definition at line 121 of file TLI_Stream.cpp. References ACE_TRACE, and ACE::t_snd(). 
 00125 {
00126   ACE_TRACE ("ACE_TLI_Stream::send");
00127   return ACE::t_snd (this->get_handle (),
00128                      buf,
00129                      n,
00130                      flags,
00131                      timeout);
00132 }
 | 
  
      
  | 
  ||||||||||||||||||||
| 
 Send n bytes, keep trying until n are sent (uses write(2)). 
 Definition at line 166 of file TLI_Stream.cpp. References ACE_TRACE, and ACE::send_n(). 
 00170 {
00171   ACE_TRACE ("ACE_TLI_Stream::send_n");
00172   return ACE::send_n (this->get_handle (),
00173                       buf,
00174                       n,
00175                       timeout,
00176                       bytes_transferred);
00177 }
 | 
  
      
  | 
  ||||||||||||||||||||||||
| 
 Send exactly n bytes to the connected socket (uses t_snd(3)). 
 Definition at line 180 of file TLI_Stream.cpp. References ACE_TRACE, and ACE::t_snd_n(). 
 00185 {
00186   ACE_TRACE ("ACE_TLI_Stream::send_n");
00187 
00188   return ACE::t_snd_n (this->get_handle (),
00189                        buf,
00190                        n,
00191                        flags,
00192                        timeout,
00193                        bytes_transferred);
00194 }
 | 
  
      
  | 
  
| 
 Set rwflag. 
 Definition at line 11 of file TLI_Stream.inl. References ACE_TRACE. Referenced by ACE_TLI_Acceptor::accept(), and ACE_TLI_Connector::connect(). 
  | 
  
      
  | 
  
| 
 
 Definition at line 42 of file TLI_Stream.h.  | 
  
      
  | 
  
| 
 
 Definition at line 43 of file TLI_Stream.h.  | 
  
      
  | 
  
| 
 Declare the dynamic allocation hooks. 
 Reimplemented from ACE_TLI. Definition at line 120 of file TLI_Stream.h.  | 
  
      
  | 
  
| 
 Indicates whether the tirdwr module should be pushed. 
 Definition at line 124 of file TLI_Stream.h.  | 
  
 
1.3.6