public void onPush(string topicName, SubscriptionChangeType changeType, int pos, string newValue) { new Thread(new ThreadStart(() => { TopicSubscriptionsCollection value; try { subscriptions.TryGetValue(topicName, out value); if (value == null) { return; } } catch (Exception) { return; } foreach (NetEventIO client in value.ToList()) { if (client != null) { client.subscriptionPush(topicName, changeType, pos, newValue); } } })).Start(); }
public bool subscriptionPush(string topicName, SubscriptionChangeType changeType, int position) { if (changeType != SubscriptionChangeType.delete) { return(false); } return(this.subscriptionPush(topicName, changeType, position, "")); }
public bool subscriptionPush(string topicName, SubscriptionChangeType changeType, int position, string newValue) { if (this.state != NetEventIOClientState.Authenticated) { return(false); } Message m = new Message(PacketType.S_subscriptionPush, topicName, ((int)changeType) + "," + position, newValue); return(this.sendMessage(m)); }