Stop the server. This method causes the serve() method to return. stop() may be invoked from within your handler, or from another thread. After stop() is called, serve() will return but the server will still be listening on the socket. serve() may then be called a
(self)
| 286 | self._write.send(b'1') |
| 287 | |
| 288 | def stop(self): |
| 289 | """Stop the server. |
| 290 | |
| 291 | This method causes the serve() method to return. stop() may be invoked |
| 292 | from within your handler, or from another thread. |
| 293 | |
| 294 | After stop() is called, serve() will return but the server will still |
| 295 | be listening on the socket. serve() may then be called again to resume |
| 296 | processing requests. Alternatively, close() may be called after |
| 297 | serve() returns to close the server socket and shutdown all worker |
| 298 | threads. |
| 299 | """ |
| 300 | self._stop = True |
| 301 | self.wake_up() |
| 302 | |
| 303 | def _select(self): |
| 304 | """Does select on open connections.""" |