private void HandleOnPublish(IWampConnection connection, PublishMessage msg) { if (!_subscriptions.ContainsKey(msg.TopicUri)) { return; } var subscriptions = new HashSet <IWampServerConnection>(msg.Eligible == null ? _subscriptions[msg.TopicUri] : _subscriptions[msg.TopicUri].Where(x => msg.Eligible.Contains(x.WebSocketConnectionInfo.Id))); if (msg.ExcludeMe.HasValue) { subscriptions.RemoveWhere(x => x.WebSocketConnectionInfo.Id == connection.WebSocketConnectionInfo.Id); } if (msg.Exclude != null) { subscriptions.RemoveWhere(x => msg.Exclude.Contains(x.WebSocketConnectionInfo.Id)); } foreach (var subscription in subscriptions) { subscription.SendPublish(msg); } }
public void SendPublish(PublishMessage message) { _wampConnection.SendPublish(message); }
public void SendPublish(PublishMessage message) { SendMessage(message); OnPublish(message); }