Re: [ADVANCED-DOTNET] Server to Browser Event Distribution

2008-01-07 Thread Ryan Heath
I have not actually tried it and its compiled with GMail ;) IHttpHandler.ProcessRequest(HttpContext c) { // register with data provider provider.DataAvailable += DataAvailable; while (true) { dataAvailable.WaitOne(); // with a timeout is probably better ... FlushData( data); }

Re: [ADVANCED-DOTNET] Server to Browser Event Distribution

2008-01-07 Thread Mark Fruhling
How can I put the initial thread to sleep and then have it awaken when the event fires? Ryan Heath wrote: I guess your HttpHandler should *never* return and always wait for an event to happen. IHttpHandler.ProcessRequest(HttpContext c) { while ( stayOpen) { WaitForEvent(); FlushData

Re: [ADVANCED-DOTNET] Server to Browser Event Distribution

2008-01-05 Thread Ryan Heath
I guess your HttpHandler should *never* return and always wait for an event to happen. IHttpHandler.ProcessRequest(HttpContext c) { while ( stayOpen) { WaitForEvent(); FlushDataToClient(); } } FWIW I liked theory of the Comet pattern until I realised it doesn't scale. A single serv

Re: [ADVANCED-DOTNET] Server to Browser Event Distribution

2008-01-04 Thread Mark Fruhling
Marc, The "Comet Pattern" is exactly what I'm trying to do. My specific question is how to create the event mechanism on the web server. The only idea I've come up with is the polling of a server object. I was hoping someone might be able to point me in a more elegant direction. Marc Brooks

Re: [ADVANCED-DOTNET] Server to Browser Event Distribution

2008-01-04 Thread Marc Brooks
> I've created an ajax chat client and I am trying to avoid doing a http call > every second to check on messages. I would like to call the web service and > the following occur. What you want is to apply the Comet pattern where you leave a "hung open" request that gets pushed into by the server

Re: [ADVANCED-DOTNET] Server to Browser Event Distribution

2008-01-04 Thread Paul Cowan
If you are using Http then you have no alternative but to have a seperate XmlHttpRequest polling for a change on the server. Something else maybe possible in something other than Http. [EMAIL PROTECTED] > Date: Fri, 4 Jan 2008 11:30:21 -0500> From: [EMAIL PROTECTED]> Subject: > [ADVANCED-DOT