X-Git-Url: http://git.tdb.fi/?p=r2c2.git;a=blobdiff_plain;f=source%2Fnetwork%2Fserver.cpp;h=c60eb70e109f296ccad3a820f10df62c958a6798;hp=a892dedd25a85c79e9ba8edd1f3c60db767855a6;hb=d13d841852d1fc5f97c40f93221745a63fae5e11;hpb=2bdb31aa8da02b8762e32cd117f270ac804c88d8 diff --git a/source/network/server.cpp b/source/network/server.cpp index a892ded..c60eb70 100644 --- a/source/network/server.cpp +++ b/source/network/server.cpp @@ -124,16 +124,7 @@ void Server::send(const P &pkt) { for(vector::const_iterator i=connections.begin(); i!=connections.end(); ++i) if(!(*i)->stale && (*i)->comm.is_handshake_done()) - { - try - { - (*i)->comm.send(pkt); - } - catch(...) - { - (*i)->stale = true; - } - } + (*i)->comm.send(pkt); } @@ -144,6 +135,7 @@ Server::Connection::Connection(Server &s, Net::StreamSocket *o): { socket->signal_end_of_file.connect(sigc::mem_fun(this, &Connection::end_of_file)); comm.signal_handshake_done.connect(sigc::mem_fun(this, &Connection::handshake_done)); + comm.signal_error.connect(sigc::mem_fun(this, &Connection::comm_error)); comm.initiate_handshake(); } @@ -279,6 +271,11 @@ void Server::Connection::receive(const TrainRoutePacket &pkt) } } +void Server::Connection::comm_error(const exception &) +{ + stale = true; +} + void Server::Connection::error(const string &msg) { ErrorPacket pkt;