コード例 #1
0
        public void BroadCastMsg()
        {
            MessageInfo message = new MessageInfo()
            {
                SendUserId   = m_CurrentUser.UserData.OpenId,
                SendUserName = m_CurrentUser.UserData.UserName,
                Content      = m_Context.Request["Content"]
            };

            string result = GetResponseData(message);

            foreach (string key in dict.Keys)
            {
                if (!string.Equals(m_CurrentUser.UserData.OpenId, key, StringComparison.OrdinalIgnoreCase))
                {
                    ServerPushResult IAsyncResult = dict[key];
                    IAsyncResult.Result = result;
                    IAsyncResult.Send();
                }
            }

            _IAsyncResult.Result = result;
            _IAsyncResult.Send();
        }
コード例 #2
0
 /// <summary>
 /// 构造方法
 /// </summary>
 public ServerPushHandler(HttpContext context, ServerPushResult _IAsyncResult)
 {
     this.m_Context     = context;
     this._IAsyncResult = _IAsyncResult;
     m_CurrentUser      = (FormsPrincipal <UserInfo>)m_Context.User;
 }