diff --git a/support/tock_support_cppcsp.h b/support/tock_support_cppcsp.h index 361d786..a5cc48d 100644 --- a/support/tock_support_cppcsp.h +++ b/support/tock_support_cppcsp.h @@ -93,12 +93,12 @@ protected: in >> c; out << c; } - out.flush(); } catch (csp::PoisonException& e) { in.poison(); } + out.flush(); } public: inline StreamWriter(std::ostream& _out,const csp::Chanin& _in) @@ -225,14 +225,21 @@ protected: { tockSendableArrayOfBytes aob(1,&c); in >> aob; - out << c; + if (c == 255) + { + out.flush(); + } + else + { + out << c; + } } - out.flush(); } catch (csp::PoisonException& e) { in.poison(); } + out.flush(); } public: inline StreamWriterByteArray(std::ostream& _out,const csp::Chanin& _in) diff --git a/testcases/echo.occ b/testcases/echo.occ index 3b1a32d..2cb9576 100644 --- a/testcases/echo.occ +++ b/testcases/echo.occ @@ -5,4 +5,5 @@ PROC echo(CHAN BYTE in, out) in ? c out ! c out ! c + out ! 255 :