public void PropogateMessage(SyncClientMessage message) { if (message == null) { message = Context.GetSyncMessage(); } else { message.Execute(Context, null); } var thread = new Thread(() => { foreach (TcpClient c in _clients) { try { Formatter.Serialize(c.GetStream(), message); } catch (SerializationException) { } catch (IOException e) { var clientName = c.Client.RemoteEndPoint.ToString(); Log("Client connection {0} propogation failed, IOException: {1}", clientName, e.Message); } } }); thread.Start(); }
private void SendMessage(SyncClientMessage message) { if (Server) { if (_server != null && _server.Running) { _server.PropogateMessage(message); } } else { if (_client != null && _client.Running) { _client.PropogateToServer(message); } } }
public void PropogateToServer(SyncClientMessage message) { SendMessage(new SyncPropogateMessage(message)); }
public SyncPropogateMessage(SyncClientMessage message) { PropogatedMessage = message; }
private void SendMessage(SyncClientMessage message) { if (Server) { if (_server != null && _server.Running) _server.PropogateMessage(message); } else { if(_client != null && _client.Running) _client.PropogateToServer(message); } }
public void PropogateMessage(SyncClientMessage message) { if (message == null) message = Context.GetSyncMessage(); else message.Execute(Context, null); var thread = new Thread(() => { foreach(TcpClient c in _clients) { try { Formatter.Serialize(c.GetStream(), message); } catch (SerializationException) { } catch (IOException e) { var clientName = c.Client.RemoteEndPoint.ToString(); Log("Client connection {0} propogation failed, IOException: {1}", clientName, e.Message); } } }); thread.Start(); }