Skip to content

Commit a7c5f63

Browse files
committed
Fix server shutdown documentation
Add server.server_close() call to shutdown example to properly release the port. Without this call, attempting to restart the server on the same port results in "Address already in use" error. Fixes #1068
1 parent a854135 commit a7c5f63

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

docs/content/exporting/http/_index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ to shutdown the server gracefully:
2424
```python
2525
server, t = start_http_server(8000)
2626
server.shutdown()
27+
server.server_close()
2728
t.join()
2829
```
2930

0 commit comments

Comments
 (0)