예제 #1
0
        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();
        }
예제 #2
0
 private void SendMessage(SyncClientMessage message)
 {
     if (Server)
     {
         if (_server != null && _server.Running)
         {
             _server.PropogateMessage(message);
         }
     }
     else
     {
         if (_client != null && _client.Running)
         {
             _client.PropogateToServer(message);
         }
     }
 }
예제 #3
0
 public void PropogateToServer(SyncClientMessage message)
 {
     SendMessage(new SyncPropogateMessage(message));
 }
예제 #4
0
 public SyncPropogateMessage(SyncClientMessage message)
 {
     PropogatedMessage = message;
 }
예제 #5
0
 private void SendMessage(SyncClientMessage message)
 {
     if (Server)
     {
         if (_server != null && _server.Running)
             _server.PropogateMessage(message);
     }
     else
     {
         if(_client != null && _client.Running)
             _client.PropogateToServer(message);
     }
 }
예제 #6
0
 public void PropogateToServer(SyncClientMessage message)
 {
     SendMessage(new SyncPropogateMessage(message));
 }
예제 #7
0
 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();
 }
예제 #8
0
 public SyncPropogateMessage(SyncClientMessage message)
 {
     PropogatedMessage = message;
 }