Example #1
0
        public void BroadcastMessage(ViewCommand cmd)
        {
            Task.Run(() => Clients.All.NewCommand(JsonHelper<ViewCommand>.ToJson(cmd)));

            PublishLogEvent("command", string.Format("Broadcast: '{0}' executed.", cmd));
        }
Example #2
0
        public void PushCommandToClients(string[] connectionIds, ViewCommand cmd)
        {
            var json = JsonHelper<ViewCommand>.ToJson(cmd);

            foreach (var connectionId in connectionIds)
            {
                Task.Run(() => Clients.Client(connectionId).NewCommand(json));
            }

            PublishLogEvent("command", string.Format("Command: '{0}' executed.", json));
        }