File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 32
32
from twisted .internet .posixbase import PosixReactorBase
33
33
from twisted .internet .interfaces import \
34
34
IReactorFDSet , IDelayedCall , IReactorTime
35
+ from twisted .python import failure
36
+ from twisted .internet import error
35
37
36
38
from zope .interface import implements
37
39
40
42
from tornado .stack_context import NullContext
41
43
from tornado .ioloop import IOLoop
42
44
45
+
43
46
class TornadoDelayedCall (object ):
44
47
"""
45
48
DelayedCall object for Tornado.
@@ -139,10 +142,15 @@ def wakeUp(self):
139
142
# IReactorFDSet
140
143
def _invoke_callback (self , fd , events ):
141
144
(reader , writer ) = self ._fds [fd ]
142
- if events | IOLoop .READ and reader :
145
+ if events & IOLoop .READ and reader :
143
146
reader .doRead ()
144
- if events | IOLoop .WRITE and writer :
147
+ if events & IOLoop .WRITE and writer :
145
148
writer .doWrite ()
149
+ if events & IOLoop .ERROR :
150
+ if reader :
151
+ reader .readConnectionLost (failure .Failure (error .ConnectionLost ()))
152
+ if writer :
153
+ writer .connectionLost (failure .Failure (error .ConnectionLost ()))
146
154
147
155
def addReader (self , reader ):
148
156
"""
You can’t perform that action at this time.
0 commit comments