Futzing w/ HTTP response/request model



Hi All,

I've recently been intrigued with this notion of "Service Streaming":

http://ajaxpatterns.org/HTTP_Streaming

in which you make use of the webserver and browsers ability to maintain
a connection using a loop on the web server. I know those of you
familiar with how IIS/asp.net (aspnet_isapi.dll) handles
HttpApplication threads (a pool) are probably very offended by this
idea but I would ask that you hear me out before flaming me :)

Performance issues aside (for a moment), I have had pretty good success
implementing a handler that keeps my connection open so that in the
browser, an AJAX-style XmlHttpRequest can remain connected and respond
to onreadystatechange events as the server pushes data.

In fact, it was rather easy : in my class implementing IHttpHandler and
within the ProcessRequest method, I merely included the following:

while(loop) { if (!context.Response.IsClientConnected) loop = false; }
context.Response.End();

where "loop" is a bool initialized as true;

The implication is that we can "futz" with HTTP response/request model
to allow a web server to act as an intermediary between clients limited
only by the number of simultaneous threads (connections) a given web
server can bear. It means chat or peer-style applications over port 80.

But I am realizing that asp.net's HttpApplication is a rather
largish-object possessing a ton of overhead one really wouldn't need
for the purpose of such applications. Basically you would be stuck with
a pretty small amount of connections that you could handle on a web
server.

I found another complication (it doesn't work and I understand there
are garbage collection issues) when I tried to implement static events
on my class that inherited HttpApplication so I could inform all
connected clients of an event (hence cause a push of data to some or
all).

I've created a few HttpModules in my time and I know that it is also
bound to HttpApplication (the HttpApplication object is pushed into
event handlers implemented in your class inheriting HttpModule) and I
realize that I can't any go further up the chain of processing (to
bypass it) without writing my own C++ Isapi filters - something I hoped
to avoid. I could write my own webserver but that is also not on my
radar.

Anyway, I was hoping for advice, comments, thoughts, suggestions on the
topic because I think it is worth investigating and could usher in a
new breed of HTTP applications now that we have AJAX support in an
increasing number of browsers.

Thanks, Rein

.



Relevant Pages

  • RE: Futzing w/ HTTP response/request model
    ... a connection using a loop on the web server. ... HttpApplication threads are probably very offended by this ... to onreadystatechange events as the server pushes data. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Outgoing POP3 email missing/lost/not received
    ... Funny thing is that I have had this ISP for 8 years and it has always been ... It looks like when you last ran CEICW, you set the ISP's mail server to: ... Internet Connection Wizard. ... After the wizard completes, the following network connection ...
    (microsoft.public.windows.server.sbs)
  • Re: Cannot connect client to server 2003
    ... you need to reconfigure the IP schema of your SBS ... On the SBS 2003 Server open the Server Management console. ... On the Connection Type page, click Broadband, and then click Next. ... Alternate DNS server, type the IP addresses that are provided by your ISP ...
    (microsoft.public.windows.server.sbs)
  • Re: Outgoing POP3 email missing/lost/not received
    ... ISP's mail server instead of the domain name on the ... SUMMARY OF SETTINGS FOR CONFIGURE E-MAIL AND INTERNET ... Internet Connection Wizard. ... After the wizard completes, the following network connection ...
    (microsoft.public.windows.server.sbs)
  • Re: Networking Question - VLANs on SBS 2003 Premium SP1
    ... port on the old router so I now have a segregated WLAN. ... be sure you do not enable any DHCP server in internal network. ... On the Connection Type page, click Broadband, and then click Next. ... On the Network Connection, You must enable and configure the network ...
    (microsoft.public.windows.server.sbs)