Message234161
Running the example from the Asynchronous Mixins section of the “socketserver” documentation generates a ResourceWarning:
$ ./python -btWall ThreadedTCPServer.py
Server loop running in thread: Thread-1
Received: Thread-2: Hello World 1
Received: Thread-3: Hello World 2
Received: Thread-4: Hello World 3
sys:1: ResourceWarning: unclosed <socket.socket fd=3, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 43804)>
There is a server_close() method mentioned in the doc string of the BaseServer class, so I assume it is meant to be part of the API. But there is no mention of it in the reference documentation.
I think server.server_close() should be documented, and called after server.shutdown() in the example. A further enhancement might be to turn BaseServer into a context manager, but I would be happy with using the existing server_close() method. |
|
Date |
User |
Action |
Args |
2015-01-17 04:32:55 | martin.panter | set | recipients:
+ martin.panter, docs@python |
2015-01-17 04:32:55 | martin.panter | set | messageid: <1421469175.0.0.628748486385.issue23254@psf.upfronthosting.co.za> |
2015-01-17 04:32:54 | martin.panter | link | issue23254 messages |
2015-01-17 04:32:54 | martin.panter | create | |
|