Disconnect and error-out all requests.
(self)
| 273 | self._send_options_message() |
| 274 | |
| 275 | def close(self): |
| 276 | """ |
| 277 | Disconnect and error-out all requests. |
| 278 | """ |
| 279 | with self.lock: |
| 280 | if self.is_closed: |
| 281 | return |
| 282 | self.is_closed = True |
| 283 | |
| 284 | log.debug("Closing connection (%s) to %s", id(self), self.endpoint) |
| 285 | reactor.callFromThread(self.transport.connector.disconnect) |
| 286 | log.debug("Closed socket to %s", self.endpoint) |
| 287 | |
| 288 | if not self.is_defunct: |
| 289 | self.error_all_requests( |
| 290 | ConnectionShutdown("Connection to %s was closed" % self.endpoint)) |
| 291 | # don't leave in-progress operations hanging |
| 292 | self.connected_event.set() |
| 293 | |
| 294 | def handle_read(self): |
| 295 | """ |
nothing calls this directly
no test coverage detected