I'm using the C# web server for listening to http equests on my server. Here is the problem:
Client sends a GET request or a POST request
Server sends the response back
Client keeps waiting for the response and doesn't receive unless the server socket is closed.
Here is a sample request/response:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:184.108.40.206) Gecko/20110218 Firefox/3.6.14 (.NET CLR 3.5.30729)
Keep-Alive: timeout=5, max=100
Date: Thu, 03 Mar 2011 03:00:53 GMT
Server: C# Webserver
The timeout is defined by:
private int _keepAliveTimeout
in HttpContext class.
The client waits for exactly the time defined in keepAliveTimeout. Any clues on why would that happen? I've tried with GET/POST with my client as well as with standard Firefox browser as client as well.
Here's how I send the response:
protected void SendResponse(RequestContext context, HttpStatusCode status)
context.Response.Status = status;
var generator = new ResponseWriter();
if (context.Request.Connection != null &&
context.Request.Connection.Type == ConnectionType.Close)
Console.WriteLine("Sending Response:" + context.Response.Status);
generator = null;
from a custom module which returns ProcessingResult.Abort; from "Process" method after the response is sent.
Is there anything I'm missing?