5 #include "jaws3/Protocol_Handler.h"
6 #include "jaws3/Concurrency.h"
8 JAWS_Protocol_State::~JAWS_Protocol_State ()
13 JAWS_Protocol_Handler::JAWS_Protocol_Handler ( JAWS_Protocol_State
*state
20 this->db_
.base ((char *) this, 0 /* an infinite queue */);
24 JAWS_Protocol_Handler::~JAWS_Protocol_Handler ()
26 this->mb_
.replace_data_block (0);
31 JAWS_Protocol_Handler::service ()
33 if (this->state_
== 0)
36 return this->state_
->service (this, this->data_
);
41 JAWS_Protocol_Handler::event_complete ( const JAWS_Event_Result
&result
45 // This call is done in the context of the dispatching
46 // thread (e.g., by the Reactor thread, or by one of the
47 // threads in the Proactor, or by the invoker of the IO
48 // if the IO is synchronous).
50 this->state_
= this->state_
->transition (result
, this->data_
, act
);
52 // At this point, we need to cue this Handler back into
53 // the concurrency mechanism. This probably means the
54 // Message Queue of some Concurrency Task.
56 JAWS_Concurrency::instance ()->putq (this);
58 // Doing it this way is less efficient than calling into
59 // the service() method of the next state directly from
60 // here, but it gains the flexibility of a more modular
61 // concurrency mechanism.