コード例 #1
0
        public virtual void PrepareHeader(HttpListenerContext context, PreparedData callData)
        {
            var response = context.Response;

            response.StatusCode      = (int)HttpStatusCode.OK;
            response.ContentLength64 = callData.Length;
            response.ContentEncoding = Encoding ?? Encoding.UTF8;
            response.ContentType     = MimeType ?? "text/html";
        }
コード例 #2
0
        public override void GenerateSite(HttpListenerContext context, PreparedData callData)
        {
            ContentSite contentData = (ContentSite)callData.Context;

            // write first part
            context.Response.OutputStream.Write(contentData.OwnContent, 0, lengthA);
            // write the inner data
            contentData.Site.GenerateSite(context, contentData.PreparedData);
            // write outer part
            context.Response.OutputStream.Write(contentData.OwnContent, startB, lengthB);
        }
コード例 #3
0
 public sealed override void GenerateSite(HttpListenerContext context, PreparedData callData)
 {
     response.Add(context.Response);
     InvokeEvent();
 }
コード例 #4
0
 public sealed override void PrepareHeader(HttpListenerContext context, PreparedData callData)
 {
     base.PrepareHeader(context, callData);
     context.Response.KeepAlive = true;
 }
コード例 #5
0
 public ContentSite(byte[] fetchBlock, WebSite site, PreparedData data)
 {
     OwnContent   = fetchBlock;
     Site         = site;
     PreparedData = data;
 }
コード例 #6
0
 public virtual void GenerateSite(HttpListenerContext context, PreparedData callData)
 {
     byte[] prepData = (byte[])callData.Context;
     context.Response.OutputStream.Write(prepData, 0, prepData.Length);
 }