public static void DispatchGenericReplicationInfo(SPClient client, ReplicationListUpdateEvent genericReplicationInfo) { var objectName = genericReplicationInfo.ObjectName; foreach (var ri in _replicationInfos) { if (ri.Key.Equals(client)) { continue; } if (ri.Value.Contains(objectName)) { ri.Key.ReplicationListUpdate(genericReplicationInfo); } } }
static void Main(string[] args) { Console.Title = "Super proxy node 1"; LogManager.Configuration = NLogDefaultConfiguration; _client = new SPClient(new TestHostedObject(), "testChannel"); _client.Connect("127.0.0.1", 6669); Thread.Sleep(1000); _client.Subsribe("testChannel", (action) => { Log.Info($"Message received from channel:{action.Channel}"); Log.Info(action.Message.Header); Log.Info(action.Message.Data.ToString()); }); Console.Read(); }
public static void Subscribe(SPClient client, RMINotyfiEvent notifyEvent) { if (!client.ReadyForRMI) { client.ReadyForRMI = true; } var count = 0; foreach (var methodName in notifyEvent.MethodNames) { Subscribe(notifyEvent.Channel, new RemoteMethodProvider() { Channel = notifyEvent.Channel, Client = client, MethodName = methodName }); count++; } #if DEBUG _log.Debug($"Client {client.Socket.RemoteEndPoint.ToString()} subscribed {count} methods to channel {notifyEvent.Channel}"); #endif }
public void InstallClient(SPClient client, string objectName) { _client = client; _objectName = objectName; _localPrimitive = typeof(T); }