3 //=============================================================================
7 * $Id: TLI_Stream.h 80826 2008-03-04 14:51:23Z wotte $
11 //=============================================================================
14 #ifndef ACE_TLI_STREAM_H
15 #define ACE_TLI_STREAM_H
16 #include /**/ "ace/pre.h"
18 #include "ace/config-lite.h"
20 #if !defined (ACE_LACKS_PRAGMA_ONCE)
22 #endif /* ACE_LACKS_PRAGMA_ONCE */
26 #include "ace/INET_Addr.h"
28 #if defined (ACE_HAS_TLI)
30 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
35 * @class ACE_TLI_Stream
37 * @brief Defines the member functions for ACE_TLI_Stream abstraction.
39 class ACE_Export ACE_TLI_Stream
: public ACE_TLI
42 friend class ACE_TLI_Acceptor
;
43 friend class ACE_TLI_Connector
;
45 // = Initialization and termination methods.
46 /// Default constructor.
47 ACE_TLI_Stream (void);
49 // = TLI-specific shutdown operations.
50 /// Close down and release resources.
53 /// Send a release and then await the release from the other side.
54 int active_close (void);
56 /// Acknowledge the release from the other side and then send the
57 /// release to the other side.
58 int passive_close (void);
60 /// Return address of remotely connected peer.
61 int get_remote_addr (ACE_Addr
&) const;
64 /// Send an n byte buffer to the connected socket (uses t_snd(3)).
65 ssize_t
send (const void *buf
,
68 const ACE_Time_Value
*timeout
= 0) const;
70 /// Recv an n byte buffer from the connected socket (uses t_rcv(3)).
71 ssize_t
recv (void *buf
,
74 const ACE_Time_Value
*timeout
= 0) const;
76 /// Send exactly n bytes to the connected socket (uses t_snd(3)).
77 ssize_t
send_n (const void *buf
,
80 const ACE_Time_Value
*timeout
= 0,
81 size_t *bytes_transferred
= 0) const;
83 /// Recv exactly n bytes from the connected socket (uses t_rcv(3)).
84 ssize_t
recv_n (void *buf
,
87 const ACE_Time_Value
*timeout
= 0,
88 size_t *bytes_transferred
= 0) const;
91 /// Send an n byte buffer to the connected socket (uses write(2)).
92 ssize_t
send (const void *buf
,
94 const ACE_Time_Value
*timeout
= 0) const;
96 /// Recv an n byte buffer from the connected socket (uses read(2)).
97 ssize_t
recv (void *buf
,
99 const ACE_Time_Value
*timeout
= 0) const;
101 /// Send n bytes, keep trying until n are sent (uses write(2)).
102 ssize_t
send_n (const void *buf
,
104 const ACE_Time_Value
*timeout
= 0,
105 size_t *bytes_transferred
= 0) const;
107 /// Recv n bytes, keep trying until n are received (uses read (2)).
108 ssize_t
recv_n (void *buf
,
110 const ACE_Time_Value
*timeout
= 0,
111 size_t *bytes_transferred
= 0) const;
114 typedef ACE_INET_Addr PEER_ADDR
;
116 /// Dump the state of an object.
117 void dump (void) const;
119 /// Declare the dynamic allocation hooks.
120 ACE_ALLOC_HOOK_DECLARE
;
123 /// Indicates whether the tirdwr module should be pushed
127 int get_rwflag (void) const;
130 void set_rwflag (int value
);
133 ACE_END_VERSIONED_NAMESPACE_DECL
135 #if defined (__ACE_INLINE__)
136 #include "ace/TLI_Stream.inl"
137 #endif /* __ACE_INLINE__ */
139 #endif /* ACE_HAS_TLI */
140 #include /**/ "ace/post.h"
141 #endif /* ACE_TLI_STREAM_H */