twisted web write to a connection closed from client-side
Hi, I have a problem: twisted does not indicate/throw exception when user has stopped reading the stream via "STOP" browser button (I guess it won't do in any other case of connection drop). Is this intended behavior and is there any way to detect that the data written to request goes nowhere? I am using twisted web to write HTTP stream that is read form asynchronous source continuously. I'm using Resource and NOT_READY_YET, then I just do request.write() infinitely until, and if, the source stops the stream, then do request.finish(). If the source does not stop and I stop the stream by hitting browser "stop" button - the twisted server continues reading source infinitely. Could not find any information about how connection resets are handled by twisted web
On 10:51 pm, realgrandrew@gmail.com wrote:
Hi,
I have a problem: twisted does not indicate/throw exception when user has stopped reading the stream via "STOP" browser button (I guess it won't do in any other case of connection drop). Is this intended behavior and is there any way to detect that the data written to request goes nowhere?
I am using twisted web to write HTTP stream that is read form asynchronous source continuously. I'm using Resource and NOT_READY_YET, then I just do request.write() infinitely until, and if, the source stops the stream, then do request.finish(). If the source does not stop and I stop the stream by hitting browser "stop" button - the twisted server continues reading source infinitely.
Could not find any information about how connection resets are handled by twisted web
I wrote about this recently, http://jcalderone.livejournal.com/50890.html Jean-Paul
Shouldn't the HTTP protocol implementation (twisted.web.http) itself respond to connectionLost? 'haps you need to augment that. -Jared -----Original Message----- From: twisted-web-bounces@twistedmatrix.com [mailto:twisted-web-bounces@twistedmatrix.com] On Behalf Of exarkun@twistedmatrix.com Sent: Friday, December 11, 2009 3:20 PM To: Twisted Web World Subject: Re: [Twisted-web] twisted web write to a connection closedfrom client-side On 10:51 pm, realgrandrew@gmail.com wrote:
Hi,
I have a problem: twisted does not indicate/throw exception when user has stopped reading the stream via "STOP" browser button (I guess it won't do in any other case of connection drop). Is this intended behavior and is there any way to detect that the data written to request goes nowhere?
I am using twisted web to write HTTP stream that is read form asynchronous source continuously. I'm using Resource and NOT_READY_YET, then I just do request.write() infinitely until, and if, the source stops the stream, then do request.finish(). If the source does not stop and I stop the stream by hitting browser "stop" button - the twisted server continues reading source infinitely.
Could not find any information about how connection resets are handled by twisted web
I wrote about this recently, http://jcalderone.livejournal.com/50890.html Jean-Paul _______________________________________________ Twisted-web mailing list Twisted-web@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
On 04:12 pm, jared.gisin@isilon.com wrote:
Shouldn't the HTTP protocol implementation (twisted.web.http) itself respond to connectionLost? 'haps you need to augment that.
It does. What else do you think it should do? Jean-Paul
Jean-Paul, thank you for your reply, I got it working great.
Anyways I suggest to indicate it somehow more clearly in the Request
documentation because Deferred interface is far from trivial.
Jean, and for your great post- could you please extend your post title
to contain "connection drop" or variants to be easier to find it via
google. You're doing great work with your "twisted in 60 seconds",
many thanks again.
On Mon, Dec 14, 2009 at 7:53 PM,
On 04:12 pm, jared.gisin@isilon.com wrote:
Shouldn't the HTTP protocol implementation (twisted.web.http) itself respond to connectionLost? 'haps you need to augment that.
It does. What else do you think it should do?
Jean-Paul
_______________________________________________ Twisted-web mailing list Twisted-web@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
participants (3)
-
Andrew Gryaznov
-
exarkun@twistedmatrix.com
-
Jared Gisin