Cleanup ACE_HAS_PTHREAD_SIGMASK_PROTOTYPE, all platforms support it so far as I can...
[ACE_TAO.git] / ACE / apps / JAWS3 / small / SS_State_READ.cpp
blob3a06c9eaba96f6771b4b00b6066c19e2a3377179
1 #include "jaws3/IO.h"
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"
8 #include "SS_Data.h"
10 int
11 TeraSS_State_READ::service (JAWS_Event_Completer *ec, void *data)
13 // Recover state.
14 TeraSS_Data *tdata = (TeraSS_Data *) data;
16 // Read until we see a newline.
17 JAWS_IO::instance ()->recv ( tdata->peer ().get_handle ()
18 , & tdata->mb ()
19 , ec
22 return 0;
25 JAWS_Protocol_State *
26 TeraSS_State_READ::transition ( const JAWS_Event_Result &result
27 , void *
28 , void *
31 // In the READ state, move to PARSE if success.
32 // Otherwise ERROR.
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 ();
40 break;
41 case JAWS_Event_Result::JE_ERROR:
42 next_state = TeraSS_State_ERROR::instance ();
43 break;
44 default:
45 // Just bail unceremoniously.
46 next_state = TeraSS_State_DONE::instance ();
47 break;
50 return next_state;