1 #include "ace/FILE_Connector.h"
2 #include "ace/FILE_Addr.h"
3 #include "ace/FILE_IO.h"
7 #include "SS_State_WRITE.h"
8 #include "SS_State_ERROR.h"
9 #include "SS_State_DONE.h"
13 TeraSS_State_WRITE::service (JAWS_Event_Completer
*ec
, void *data
)
15 JAWS_Event_Result
fake_bad_result (0, JAWS_Event_Result::JE_ERROR
);
18 TeraSS_Data
*tdata
= (TeraSS_Data
*) data
;
20 ACE_FILE_Addr
file_addr (tdata
->mb ().rd_ptr ());
21 ACE_FILE_Connector file_connector
;
23 if (file_connector
.connect ( tdata
->file_io ()
31 ec
->output_complete (fake_bad_result
, & tdata
->file_io ());
36 JAWS_IO::instance ()->transmit ( tdata
->peer ().get_handle ()
37 , tdata
->file_io ().get_handle ()
46 TeraSS_State_WRITE::transition ( const JAWS_Event_Result
&result
53 ((ACE_FILE_IO
*) act
)->close ();
55 // In the WRITE state, move to DONE state if success, ERROR if error.
57 JAWS_Protocol_State
*next_state
= 0;
59 switch (result
.status ())
61 case JAWS_Event_Result::JE_OK
:
62 next_state
= TeraSS_State_DONE::instance ();
64 case JAWS_Event_Result::JE_ERROR
:
65 next_state
= TeraSS_State_ERROR::instance ();
68 // Just bail unceremoniously.
69 next_state
= TeraSS_State_DONE::instance ();