ACE_INet  6.1.0
Classes | Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes
ACE::IOS::StreamHandler< ACE_PEER_STREAM_1, ACE_SYNCH_DECL > Class Template Reference

#include <StreamHandler.h>

Inheritance diagram for ACE::IOS::StreamHandler< ACE_PEER_STREAM_1, ACE_SYNCH_DECL >:
Inheritance graph
[legend]
Collaboration diagram for ACE::IOS::StreamHandler< ACE_PEER_STREAM_1, ACE_SYNCH_DECL >:
Collaboration graph
[legend]

List of all members.

Classes

class  NotificationStrategyGuard

Public Types

typedef StreamHandler
< ACE_PEER_STREAM,
ACE_SYNCH_USE
this_type
typedef ACE_Svc_Handler
< ACE_PEER_STREAM,
ACE_SYNCH_USE
base_type
typedef ACE_Message_Queue
< ACE_SYNCH_USE
mq_type

Public Member Functions

 StreamHandler (const ACE_Synch_Options &synch_options=ACE_Synch_Options::defaults, ACE_Thread_Manager *thr_mgr=0, mq_type *mq=0, ACE_Reactor *reactor=ACE_Reactor::instance())
 Constructor.
virtual ~StreamHandler ()
 Destructor.
virtual int open (void *=0)
 Activate the connection.
virtual int close (u_long flags=0)
 Close the connection.
virtual int handle_input (ACE_HANDLE)
virtual int handle_output (ACE_HANDLE)
int read_from_stream (void *buf, size_t length, u_short char_size)
 Called by streambuffer to read/receive new data from peer.
int write_to_stream (const void *buf, size_t length, u_short char_size)
 Called by streambuffer to send new data to peer.
bool is_connected () const
 Returns true as long as the connection to peer is active.
bool using_reactor () const
 Returns true if StreamHandler has been configured for reactive mode.

Private Types

enum  { MAX_INPUT_SIZE = 4096 }

Private Member Functions

int handle_output_i (ACE_Time_Value *timeout=0)
int handle_input_i (size_t rdlen, ACE_Time_Value *timeout=0)
int process_input (char *buf, size_t &char_length, u_short char_size, ACE_Time_Value *timeout)
 processes queued input
bool use_timeout () const
 Returns true if a timeout is to be used on IO operations.
bool char_in_queue (u_short char_size)
 Returns true is the queued data contains at least char_size bytes.

Private Attributes

bool connected_
ACE_Synch_Options sync_opt_
bool send_timeout_
bool receive_timeout_
ACE_Reactor_Notification_Strategy notification_strategy_

template<ACE_PEER_STREAM_1, ACE_SYNCH_DECL>
class ACE::IOS::StreamHandler< ACE_PEER_STREAM_1, ACE_SYNCH_DECL >


Member Typedef Documentation

template<ACE_PEER_STREAM_1 , ACE_SYNCH_DECL >
typedef ACE_Message_Queue<ACE_SYNCH_USE> ACE::IOS::StreamHandler< ACE_PEER_STREAM_1, ACE_SYNCH_DECL >::mq_type

Member Enumeration Documentation

template<ACE_PEER_STREAM_1 , ACE_SYNCH_DECL >
anonymous enum [private]
Enumerator:
MAX_INPUT_SIZE 

Constructor & Destructor Documentation

template<ACE_PEER_STREAM_1 , ACE_SYNCH_DECL >
ACE::IOS::StreamHandler< ACE_PEER_STREAM_1, ACE_SYNCH_DECL >::StreamHandler ( const ACE_Synch_Options synch_options = ACE_Synch_Options::defaults,
ACE_Thread_Manager thr_mgr = 0,
mq_type mq = 0,
ACE_Reactor reactor = ACE_Reactor::instance () 
)

Constructor.

template<ACE_PEER_STREAM_1 , ACE_SYNCH_DECL >
ACE::IOS::StreamHandler< ACE_PEER_STREAM_1, ACE_SYNCH_DECL >::~StreamHandler ( ) [virtual]

Destructor.


Member Function Documentation

template<ACE_PEER_STREAM_1 , ACE_SYNCH_DECL >
bool ACE::IOS::StreamHandler< ACE_PEER_STREAM_1, ACE_SYNCH_DECL >::char_in_queue ( u_short  char_size) [private]

Returns true is the queued data contains at least char_size bytes.

template<ACE_PEER_STREAM_1 , ACE_SYNCH_DECL >
int ACE::IOS::StreamHandler< ACE_PEER_STREAM_1, ACE_SYNCH_DECL >::close ( u_long  flags = 0) [virtual]

Close the connection.

Reimplemented from ACE_Svc_Handler< ACE_PEER_STREAM, ACE_SYNCH_USE >.

template<ACE_PEER_STREAM_1 , ACE_SYNCH_DECL >
int ACE::IOS::StreamHandler< ACE_PEER_STREAM_1, ACE_SYNCH_DECL >::handle_input ( ACE_HANDLE  ) [virtual]

Called to handle incoming data when using StreamHandler in reactive mode

Reimplemented from ACE_Event_Handler.

template<ACE_PEER_STREAM_1 , ACE_SYNCH_DECL >
int ACE::IOS::StreamHandler< ACE_PEER_STREAM_1, ACE_SYNCH_DECL >::handle_input_i ( size_t  rdlen,
ACE_Time_Value timeout = 0 
) [private]

Attempts to send queued data to peer. Called either from handle_output in reactive mode or directly from write_to_stream when non-reactive.

template<ACE_PEER_STREAM_1 , ACE_SYNCH_DECL >
int ACE::IOS::StreamHandler< ACE_PEER_STREAM_1, ACE_SYNCH_DECL >::handle_output ( ACE_HANDLE  ) [virtual]

Called to handle outgoing data when using StreamHandler in reactive mode

Reimplemented from ACE_Event_Handler.

template<ACE_PEER_STREAM_1 , ACE_SYNCH_DECL >
int ACE::IOS::StreamHandler< ACE_PEER_STREAM_1, ACE_SYNCH_DECL >::handle_output_i ( ACE_Time_Value timeout = 0) [private]

Attempts to receive data from peer and queue it. Called either from handle_input in reactive mode or directly from read_from_stream when non-reactive.

template<ACE_PEER_STREAM_1 , ACE_SYNCH_DECL >
bool ACE::IOS::StreamHandler< ACE_PEER_STREAM_1, ACE_SYNCH_DECL >::is_connected ( ) const

Returns true as long as the connection to peer is active.

template<ACE_PEER_STREAM_1 , ACE_SYNCH_DECL >
int ACE::IOS::StreamHandler< ACE_PEER_STREAM_1, ACE_SYNCH_DECL >::open ( void *  = 0) [virtual]

Activate the connection.

Reimplemented from ACE_Svc_Handler< ACE_PEER_STREAM, ACE_SYNCH_USE >.

template<ACE_PEER_STREAM_1 , ACE_SYNCH_DECL >
int ACE::IOS::StreamHandler< ACE_PEER_STREAM_1, ACE_SYNCH_DECL >::process_input ( char *  buf,
size_t &  char_length,
u_short  char_size,
ACE_Time_Value timeout 
) [private]

processes queued input

template<ACE_PEER_STREAM_1 , ACE_SYNCH_DECL >
int ACE::IOS::StreamHandler< ACE_PEER_STREAM_1, ACE_SYNCH_DECL >::read_from_stream ( void *  buf,
size_t  length,
u_short  char_size 
)

Called by streambuffer to read/receive new data from peer.

template<ACE_PEER_STREAM_1 , ACE_SYNCH_DECL >
bool ACE::IOS::StreamHandler< ACE_PEER_STREAM_1, ACE_SYNCH_DECL >::use_timeout ( ) const [private]

Returns true if a timeout is to be used on IO operations.

template<ACE_PEER_STREAM_1 , ACE_SYNCH_DECL >
bool ACE::IOS::StreamHandler< ACE_PEER_STREAM_1, ACE_SYNCH_DECL >::using_reactor ( ) const

Returns true if StreamHandler has been configured for reactive mode.

template<ACE_PEER_STREAM_1 , ACE_SYNCH_DECL >
int ACE::IOS::StreamHandler< ACE_PEER_STREAM_1, ACE_SYNCH_DECL >::write_to_stream ( const void *  buf,
size_t  length,
u_short  char_size 
)

Called by streambuffer to send new data to peer.


Member Data Documentation

template<ACE_PEER_STREAM_1 , ACE_SYNCH_DECL >
bool ACE::IOS::StreamHandler< ACE_PEER_STREAM_1, ACE_SYNCH_DECL >::connected_ [private]
template<ACE_PEER_STREAM_1 , ACE_SYNCH_DECL >
bool ACE::IOS::StreamHandler< ACE_PEER_STREAM_1, ACE_SYNCH_DECL >::receive_timeout_ [private]
template<ACE_PEER_STREAM_1 , ACE_SYNCH_DECL >
bool ACE::IOS::StreamHandler< ACE_PEER_STREAM_1, ACE_SYNCH_DECL >::send_timeout_ [private]
template<ACE_PEER_STREAM_1 , ACE_SYNCH_DECL >
ACE_Synch_Options ACE::IOS::StreamHandler< ACE_PEER_STREAM_1, ACE_SYNCH_DECL >::sync_opt_ [private]

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines