3 //=============================================================================
5 * @file HTBP_Notifier.cpp
7 * @author Phil Mesnier, Priyanka Gontla
9 //=============================================================================
10 #include "HTBP_Notifier.h"
11 #include "HTBP_Channel.h"
12 #include "HTBP_Session.h"
13 #include "ace/Reactor.h"
15 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
17 ACE::HTBP::Notifier::Notifier (ACE::HTBP::Channel
*s
)
23 ACE::HTBP::Notifier::handle_input(ACE_HANDLE
)
25 switch (this->channel_
->state())
27 case ACE::HTBP::Channel::Detached
:
28 this->channel_
->pre_recv();
30 case ACE::HTBP::Channel::Wait_For_Ack
:
31 this->channel_
->recv_ack();
34 this->channel_
->load_buffer();
37 if (this->channel_
->state() == ACE::HTBP::Channel::Closed
)
43 if (this->channel_
->session_
)
45 if (this->channel_
== this->channel_
->session_
->inbound())
47 ACE_Event_Handler
*h
= this->channel_
->session_
->handler();
48 if (h
&& this->reactor())
49 this->reactor()->notify(h
,
50 ACE_Event_Handler::READ_MASK
);
53 ACE_TEXT ("(%P|%t) ACE::HTBP::Notifier::handle_input ")
54 ACE_TEXT ("Notifier cannot notify, session has no ")
55 ACE_TEXT ("handler (%x), or reactor (%x)\n"),
59 this->channel_
->flush_buffer();
63 ACE_TEXT ("(%P|%t) ACE::HTBP::Notifier::handle_input ")
64 ACE_TEXT ("Notifier has no session to notify!\n")));
69 ACE::HTBP::Notifier::handle_output (ACE_HANDLE
)
75 ACE::HTBP::Notifier::unregister ()
78 this->reactor()->remove_handler(this,
79 ACE_Event_Handler::READ_MASK
|
80 ACE_Event_Handler::DONT_CALL
);
84 ACE::HTBP::Notifier::get_handle() const
86 return this->channel_
->ace_stream().get_handle();
89 ACE_END_VERSIONED_NAMESPACE_DECL