Re: FastCGI, Comet and Client Link failure

Howard May <Howard.May-3Vf4qVogE1JWk0Htik3J/[email protected]> Thu, 14 Jan 2010 10:56:47 -0500
Newsgroups gmane.comp.web.fastcgi.devel
Message-ID <[email protected]>
Hi Jay,

Have a look at "http://en.wikipedia.org/wiki/Comet_(programming)" to see how HTTP transactions can be used for server push events. A common application of this sort of technology is browser based web chat.

My understanding is that this is possible with fastCGI but as I've explained I am unsure about this specific aspect.

Cheers


________________________________
From: Jay Sprenkle [mailto:[email protected]]
Sent: 14 January 2010 15:48
To: Howard May
Subject: Re: [FASTCGI] FastCGI, Comet and Client Link failure

HTTP is by design transactional. You make a request, get a response, and the connection can then close without hurting anything. Do you want something that's more permanently connected or just to deliver a file? There are methods designed for delivering file content and even restarting lost connections.
On Thu, Jan 14, 2010 at 9:37 AM, Howard May <Howard.May-3Vf4qVogE1JWk0Htik3J/[email protected]<mailto:Howard.May-3Vf4qVogE1JWk0Htik3J/[email protected]>> wrote:
Hi Jay,

I start a new comet connection after I accept a FCGX_Accept_r returns a FCGX_Request with a URL of "http://<my server>/new_comet_connection_please". I can then send chunks down this connection using FCGX_FPrintF. I do not call FCGX_Finish_r for this request because I want to leave the HTTP transaction open for further data.

So fastCGI is giving me access to a new HTTP transaction and the FCGXFPrintF function allows my fastcgi application to send chunks to the web server (Abyss at present) to pass to the remote Client. So far so good. My problem is that at some point the TCP connection to the Client may die and I don't at present have any way of detecting this.

Cheers



________________________________
From: Jay Sprenkle [mailto:[email protected]<mailto:[email protected]>]
Sent: 14 January 2010 15:24
To: Howard May
Cc: fastcgi-developers-xGejAJT2w6xVgU18Zptdi0EOCMrvLtNR@public.gmane.org<mailto:[email protected]>
Subject: Re: [FASTCGI] FastCGI, Comet and Client Link failure

fastcgi is a transactional style application. If you want to run a persistent program you probably want the fastcgi application to communicate requests to, and retrieve status from, the daemon/service that implements your comet connection.
On Thu, Jan 14, 2010 at 6:23 AM, Howard May <Howard.May-3Vf4qVogE1JWk0Htik3J/[email protected]<mailto:Howard.May-3Vf4qVogE1JWk0Htik3J/[email protected]>> wrote:
Consider a simple fastCGI application with a comet connection to a remote Client. The application is periodically sending chunks to the Client but at some point the Client connection fails. How and when does the fastCGI application learn about this?





--
Cause united breaks guitars
http://www.youtube.com/watch?v=5YGc4zOqozo

_______________________________________________
FastCGI-developers mailing list
FastCGI-developers-xGejAJT2w6xVgU18Zptdi0EOCMrvLtNR@public.gmane.org
http://mailman.pins.net/mailman/listinfo.cgi/fastcgi-developers