X-Git-Url: http://git.tdb.fi/?p=libs%2Fnet.git;a=blobdiff_plain;f=source%2Fnet%2Fcommunicator.h;h=cd465a52d525c25cf837db2cca614a5a6e8cfc98;hp=8530db128d26c5d168d99fb0af34e7c874484ffc;hb=fa637ffb18421300e401a782d28dd729a3960ac4;hpb=50e9f9ea7f7385a2c5931fca2b8fb1103078e67c diff --git a/source/net/communicator.h b/source/net/communicator.h index 8530db1..cd465a5 100644 --- a/source/net/communicator.h +++ b/source/net/communicator.h @@ -19,6 +19,7 @@ class Communicator { public: sigc::signal signal_handshake_done; + sigc::signal signal_error; private: StreamSocket &socket; @@ -47,7 +48,17 @@ public: if(handshake_status!=2) throw sequence_error("handshaking not done"); unsigned size = protocol.assemble(pkt, out_buf, buf_size); - socket.write(out_buf, size); + try + { + socket.write(out_buf, size); + } + catch(const std::exception &e) + { + good = false; + if(signal_error.empty()) + throw; + signal_error.emit(e); + } } private: