Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

TLI_Stream.h

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

Generated on Mon Jun 16 11:21:55 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002