Пример #1
0
        /// <summary>
        /// 执行结果
        /// </summary>
        /// <param name="context">上下文</param>
        public override void ExecuteResult(RequestContext context)
        {
            context.Response.ContentType = "text/event-stream";
            context.Response.WriteHeader();

            var session =((IWrapper) context.Response).UnWrap();
            var wapper = new HttpEventSession(session);
            session.SetProtocolWrapper("sse", wapper);

            if (this.httpEvent != null)
            {
                wapper.SendEvent(this.httpEvent);
            }
        }
Пример #2
0
        /// <summary>
        /// 执行结果
        /// </summary>
        /// <param name="context">上下文</param>
        public override void ExecuteResult(RequestContext context)
        {
            context.Response.ContentType = "text/event-stream";
            context.Response.WriteHeader();

            var session = ((IWrapper)context.Response).UnWrap();
            var wapper  = new HttpEventSession(session);

            session.SetProtocolWrapper(Protocol.SeverSendEvent, wapper);

            if (this.httpEvent != null)
            {
                wapper.SendEvent(this.httpEvent);
            }
        }