[Twisted-web] Newbie question : client connection lost

Sebastien PASTOR sebastien.pastor at gmx.com
Tue May 11 09:46:36 EDT 2010


It looks to me that this is what i am doin ... I really might be
doing something wrong here but can t see what.
The only difference with the livejournal's code is that i am trying to
run a blocking code so i am doing a threads.deferToThread instead of doing a 
callLater. 
To test the connection lost, client side i am disabling the wifi while
the server is blocking (sleeping). At the end of the blocking code:
request.write() and finish() are done as if the connection was available
and my ErrCallBack is not called.

I hope i am clear... in attachment the code i am using 


Thanks for your time

Seb






On Tue, May 11, 2010 at 12:54:40PM +0100, Phil Mayers wrote:
> On 11/05/10 13:23, Sebastien PASTOR wrote:
> > Thanks Phil,
> >
> > I managed to be notified when the connection is cleanly closed by the
> > client (ie: browser is stop or close window).
> > But i could not handle non-clean connection closure (ie: when wifi  goes
> > down client side for instance). request.finish() does not event raise
> > any error. ...
> > I am a bit stuck here. .. any ideas ?
> 
> I'm not sure I follow.
> 
> Have a look at this to make sure you're using it properly:
> 
> http://jcalderone.livejournal.com/50890.html
> 
> _______________________________________________
> Twisted-web mailing list
> Twisted-web at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
-------------- next part --------------
A non-text attachment was scrubbed...
Name: delay.py
Type: text/x-python
Size: 1083 bytes
Desc: not available
Url : http://twistedmatrix.com/pipermail/twisted-web/attachments/20100511/36415b90/attachment.py 


More information about the Twisted-web mailing list