Ticket #4173: connectionlost.patch
| File connectionlost.patch, 1.0 KB (added by mfenniak, 3 years ago) |
|---|
-
twisted/web/websocket.py
12 12 """ 13 13 14 14 15 from twisted.internet.error import ConnectionDone 15 16 from twisted.web.http import datetimeToString 16 17 from twisted.web.server import Request, Site, version, unquote 17 18 … … 170 171 171 172 def __init__(self, request): 172 173 self._request = request 173 self._request.notifyFinish().add Errback(self._connectionLost)174 self._request.notifyFinish().addCallbacks(self._connectionLost, self._finishError) 174 175 175 176 177 def _finishError(self, failure): 178 """ 179 Traps ConnectionDone (client-side disconnect) and forwards the event to 180 the L{WebSocketHandler}. 181 """ 182 failure.trap(ConnectionDone) 183 self._handler.connectionLost(failure) 184 185 176 186 def _attachHandler(self, handler): 177 187 """ 178 188 Attach the given L{WebSocketHandler} to this transport.
