Shutdown and close the socket.
(sock)
| 130 | |
| 131 | |
| 132 | def close_socket(sock): |
| 133 | """Shutdown and close the socket.""" |
| 134 | try: |
| 135 | shut_down(sock) |
| 136 | except Exception: # pragma: no cover |
| 137 | pass |
| 138 | sock.close() |
| 139 | |
| 140 | |
| 141 | def serve(name, handler, host, port=0, backlog=socket.SOMAXCONN, timeout=None): |