2 #include "jaws3/Event_Completer.h"
4 #include "SS_State_READ.h"
5 #include "SS_State_PARSE.h"
6 #include "SS_State_ERROR.h"
7 #include "SS_State_DONE.h"
11 TeraSS_State_READ::service (JAWS_Event_Completer
*ec
, void *data
)
14 TeraSS_Data
*tdata
= (TeraSS_Data
*) data
;
16 // Read until we see a newline.
17 JAWS_IO::instance ()->recv ( tdata
->peer ().get_handle ()
26 TeraSS_State_READ::transition ( const JAWS_Event_Result
&result
31 // In the READ state, move to PARSE if success.
34 JAWS_Protocol_State
*next_state
= 0;
36 switch (result
.status ())
38 case JAWS_Event_Result::JE_OK
:
39 next_state
= TeraSS_State_PARSE::instance ();
41 case JAWS_Event_Result::JE_ERROR
:
42 next_state
= TeraSS_State_ERROR::instance ();
45 // Just bail unceremoniously.
46 next_state
= TeraSS_State_DONE::instance ();