using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QM.Exchange.Interface;
namespace QM.Exchange.Custom.Commands.Samples
{
///
/// 功能描述:BroadcastCommand 广播命令
/// 作 者:董雪夫
/// 编写日期:2017.8.23
///
public class BroadcastCommand : DataCommand
{
public BroadcastCommand(CommonMessage message)
: base(message)
{
}
///
/// 执行方法
///
public override void Execute(IExChangeContext exChangeContext, CommonMessage message)
{
var lst = exChangeContext.GetWokerList();
if (lst != null && lst.Count > 0)
{
foreach (var item in lst)
{
exChangeContext.SendMessageToClient(item.SessionID, message);
}
}
}
}
}