TLI_Stream.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    TLI_Stream.h
00006  *
00007  *  TLI_Stream.h,v 4.20 2006/04/19 11:54:16 jwillemsen Exp
00008  *
00009  *  @author Doug Schmidt
00010  */
00011 //=============================================================================
00012 
00013 
00014 #ifndef ACE_TLI_STREAM_H
00015 #define ACE_TLI_STREAM_H
00016 #include /**/ "ace/pre.h"
00017 
00018 #include "ace/config-lite.h"
00019 
00020 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00021 # pragma once
00022 #endif /* ACE_LACKS_PRAGMA_ONCE */
00023 
00024 #include "ace/TLI.h"
00025 
00026 #include "ace/INET_Addr.h"
00027 
00028 #if defined (ACE_HAS_TLI)
00029 
00030 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00031 
00032 class ACE_Time_Value;
00033 
00034 /**
00035  * @class ACE_TLI_Stream
00036  *
00037  * @brief Defines the member functions for ACE_TLI_Stream abstraction.
00038  */
00039 class ACE_Export ACE_TLI_Stream : public ACE_TLI
00040 {
00041 public:
00042   friend class ACE_TLI_Acceptor;
00043   friend class ACE_TLI_Connector;
00044 
00045   // = Initialization and termination methods.
00046   /// Default constructor.
00047   ACE_TLI_Stream (void);
00048 
00049   // = TLI-specific shutdown operations.
00050   /// Close down and release resources.
00051   int close (void);
00052 
00053   /// Send a release and then await the release from the other side.
00054   int active_close (void);
00055 
00056   /// Acknowledge the release from the other side and then send the
00057   /// release to the other side.
00058   int passive_close (void);
00059 
00060   /// Return address of remotely connected peer.
00061   int get_remote_addr (ACE_Addr &) const;
00062 
00063   // =  timod bindings
00064   /// Send an n byte buffer to the connected socket (uses t_snd(3)).
00065   ssize_t send (const void *buf,
00066                 size_t n,
00067                 int flags,
00068                 const ACE_Time_Value *timeout = 0) const;
00069 
00070   /// Recv an n byte buffer from the connected socket (uses t_rcv(3)).
00071   ssize_t recv (void *buf,
00072                 size_t n,
00073                 int *flags,
00074                 const ACE_Time_Value *timeout = 0) const;
00075 
00076   /// Send exactly n bytes to the connected socket (uses t_snd(3)).
00077   ssize_t send_n (const void *buf,
00078                   size_t n,
00079                   int flags,
00080                   const ACE_Time_Value *timeout = 0,
00081                   size_t *bytes_transferred = 0) const;
00082 
00083   /// Recv exactly n bytes from the connected socket (uses t_rcv(3)).
00084   ssize_t recv_n (void *buf,
00085                   size_t n,
00086                   int *flags,
00087                   const ACE_Time_Value *timeout = 0,
00088                   size_t *bytes_transferred = 0) const;
00089 
00090   // = tirdwr bindings
00091   /// Send an n byte buffer to the connected socket (uses write(2)).
00092   ssize_t send (const void *buf,
00093                 size_t n,
00094                 const ACE_Time_Value *timeout = 0) const;
00095 
00096   /// Recv an n byte buffer from the connected socket (uses read(2)).
00097   ssize_t recv (void *buf,
00098                 size_t n,
00099                 const ACE_Time_Value *timeout = 0) const;
00100 
00101   /// Send n bytes, keep trying until n are sent (uses write(2)).
00102   ssize_t send_n (const void *buf,
00103                   size_t n,
00104                   const ACE_Time_Value *timeout = 0,
00105                   size_t *bytes_transferred = 0) const;
00106 
00107   /// Recv n bytes, keep trying until n are received (uses read (2)).
00108   ssize_t recv_n (void *buf,
00109                   size_t n,
00110                   const ACE_Time_Value *timeout = 0,
00111                   size_t *bytes_transferred = 0) const;
00112 
00113   // = Meta-type info
00114   typedef ACE_INET_Addr PEER_ADDR;
00115 
00116   /// Dump the state of an object.
00117   void dump (void) const;
00118 
00119   /// Declare the dynamic allocation hooks.
00120   ACE_ALLOC_HOOK_DECLARE;
00121 
00122 private:
00123   /// Indicates whether the tirdwr module should be pushed
00124   int rwflag_;
00125 
00126   /// Get rwflag
00127   int get_rwflag (void) const;
00128 
00129   /// Set rwflag
00130   void set_rwflag (int value);
00131 };
00132 
00133 ACE_END_VERSIONED_NAMESPACE_DECL
00134 
00135 #if defined (__ACE_INLINE__)
00136 #include "ace/TLI_Stream.inl"
00137 #endif /* __ACE_INLINE__ */
00138 
00139 #endif /* ACE_HAS_TLI */
00140 #include /**/ "ace/post.h"
00141 #endif /* ACE_TLI_STREAM_H */

Generated on Thu Nov 9 09:42:08 2006 for ACE by doxygen 1.3.6