/* $Id$
This file is part of R²C²
-Copyright © 2009-2010 Mikkosoft Productions, Mikko Rasa
+Copyright © 2009-2011 Mikkosoft Productions, Mikko Rasa
Distributed under the GPL
*/
void Server::send(const P &pkt)
{
for(vector<Connection *>::const_iterator i=connections.begin(); i!=connections.end(); ++i)
- if(!(*i)->stale)
- (*i)->comm.send(pkt);
+ if(!(*i)->stale && (*i)->comm.is_handshake_done())
+ {
+ try
+ {
+ (*i)->comm.send(pkt);
+ }
+ catch(...)
+ {
+ (*i)->stale = true;
+ }
+ }
}