void IPhraseSender.Send(NetworkPhrase phrase, PhraseSender sender) { foreach (var client in this.Clients) { client.Network.Send(phrase, sender); } }
void IPhraseSender.Send(NetworkPhrase phrase, PhraseSender sender) { foreach (var client in this.server.Clients) { if (client == this) { continue; } client.network.Send(phrase, sender); } }
public void Send(NetworkPhrase phrase, PhraseSender sender) { lock (this.writer) { try { this.writer.Write((int)phrase); this.writer.Flush(); sender(this.writer); } catch (IOException ex) when(ex.HResult == -2146232800) // Connection closed { // just ignore the exception } } }
public void Send(NetworkPhrase phrase, PhraseSender sender) { lock (this.writer) { try { this.writer.Write((int)phrase); this.writer.Flush(); sender(this.writer); } catch (IOException ex) when (ex.HResult == -2146232800) // Connection closed { // just ignore the exception } } }