X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fnet%2Fcommunicator.cpp;h=618e8b45e9e295f01fc4948ef19daecd56f51242;hb=6f6845971a21c2d7e04b87925f5e657f0f20ca0d;hp=c9b277d3748de137381b0df792d5230b0e8e0c62;hpb=debe1004676d5431e571d9c4361072661dcc88c4;p=libs%2Fnet.git diff --git a/source/net/communicator.cpp b/source/net/communicator.cpp index c9b277d..618e8b4 100644 --- a/source/net/communicator.cpp +++ b/source/net/communicator.cpp @@ -1,6 +1,8 @@ #include #include "communicator.h" +using namespace std; + namespace { using namespace Msp::Net; @@ -85,9 +87,10 @@ void Communicator::data_available() if(!good) return; - in_end += socket.read(in_end, in_buf+buf_size-in_end); try { + in_end += socket.read(in_end, in_buf+buf_size-in_end); + bool more = true; while(more) { @@ -114,10 +117,12 @@ void Communicator::data_available() } } } - catch(...) + catch(const exception &e) { good = false; - throw; + if(signal_error.empty()) + throw; + signal_error.emit(e); } }