X-Git-Url: http://git.tdb.fi/?p=libs%2Fnet.git;a=blobdiff_plain;f=source%2Fcommunicator.h;h=8530db128d26c5d168d99fb0af34e7c874484ffc;hp=0aa152cd6c803e37410bc641abeb17f0d5748a3f;hb=6102d830138013216241b6723527246764103fa0;hpb=4696a776e2875697ea0d6a733609dd9c37918971 diff --git a/source/communicator.h b/source/communicator.h index 0aa152c..8530db1 100644 --- a/source/communicator.h +++ b/source/communicator.h @@ -30,6 +30,7 @@ private: char *in_begin; char *in_end; char *out_buf; + bool good; public: Communicator(StreamSocket &, const Protocol &, ReceiverBase &); @@ -41,6 +42,8 @@ public: template void send(const P &pkt) { + if(!good) + throw sequence_error("connection aborted"); if(handshake_status!=2) throw sequence_error("handshaking not done"); unsigned size = protocol.assemble(pkt, out_buf, buf_size);