Hello everyone,
I need a new web server for our existing website and I don't want
subscribe to the whole IIS way of doing things. I thought I would
implement a custom web server using the new HttpListener interface to
HTTP.SYS.
However, I found after playing with HttpListener that it seems to
completely block all handling of incoming requests from the same IP
address while a response to that IP address is outstanding. For
example, if I do the following:
System.IO.Stream respStream = context.Response.OutputStream;
foreach (byte b in buffer)
{
respStream.WriteByte(b);
Thread.Sleep(500);
}
respStream.Close();
I can see the a, b, c, d, ... characters appear properly in my browser.
However, for as long as this response is outstanding, any other
requests from the same IP address will be queued and not passed to my
application.
I reproduced this result on Windows XP SP2 as well as on Windows 2003
Server.
Does HttpListener have a limit of 1 simultaneous pending request for
each individual client? If so, how can we get rid of this limit? It is
completely unviable for our website to allow only 1 simultaneous
connection at a time. A website visitor needs to be able to have
multiple downloads running at a time, and they need to be able to
browse the website while they are downloading. We need to permit at
least 4 pending responses simultaneously.
Is there any way we can use HttpListener to do this?
Best regards,
denis