New submission from Martin Panter:

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.

----------
assignee: docs@python
components: Documentation
messages: 234161
nosy: docs@python, vadmium
priority: normal
severity: normal
status: open
title: Document how to close the TCPServer listening socket
type: enhancement

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue23254>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to