{"action":"created","issue":{"url":"https://api.github.com/repos/hyperium/hyper/issues/1575","repository_url":"https://api.github.com/repos/hyperium/hyper","labels_url":"https://api.github.com/repos/hyperium/hyper/issues/1575/labels{/name}","comments_url":"https://api.github.com/repos/hyperium/hyper/issues/1575/comments","events_url":"https://api.github.com/repos/hyperium/hyper/issues/1575/events","html_url":"https://github.com/hyperium/hyper/issues/1575","id":334553876,"node_id":"MDU6SXNzdWUzMzQ1NTM4NzY=","number":1575,"title":"How do I shut down a server cleanly?","user":{"login":"dylanede","id":10339269,"node_id":"MDQ6VXNlcjEwMzM5MjY5","avatar_url":"https://avatars3.githubusercontent.com/u/10339269?v=4","gravatar_id":"","url":"https://api.github.com/users/dylanede","html_url":"https://github.com/dylanede","followers_url":"https://api.github.com/users/dylanede/followers","following_url":"https://api.github.com/users/dylanede/following{/other_user}","gists_url":"https://api.github.com/users/dylanede/gists{/gist_id}","starred_url":"https://api.github.com/users/dylanede/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dylanede/subscriptions","organizations_url":"https://api.github.com/users/dylanede/orgs","repos_url":"https://api.github.com/users/dylanede/repos","events_url":"https://api.github.com/users/dylanede/events{/privacy}","received_events_url":"https://api.github.com/users/dylanede/received_events","type":"User","site_admin":false},"labels":[{"id":128399797,"node_id":"MDU6TGFiZWwxMjgzOTk3OTc=","url":"https://api.github.com/repos/hyperium/hyper/labels/A-server","name":"A-server","color":"fbca04","default":false},{"id":872549968,"node_id":"MDU6TGFiZWw4NzI1NDk5Njg=","url":"https://api.github.com/repos/hyperium/hyper/labels/B-rfc","name":"B-rfc","color":"1d76db","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-06-21T15:49:45Z","updated_at":"2018-07-14T21:10:06Z","closed_at":null,"author_association":"NONE","body":"After spawning a server on a tokio `Runtime`, then shutting down the runtime (using `shutdown_now`), recreating a server on the same IP and port with a new `Runtime` panics, claiming\r\n\r\n```text\r\nerror creating server listener: Only one usage of each socket address (protocol/network address/port) is normally permitted. (os error 10048)\r\n```\r\n\r\nIf I instead recreate the server by restarting the process, it works fine.\r\n\r\nThis behaviour is being observed on Windows 7. I have tried sleeping the thread for up to 10 seconds before recreating the server and the same error occurs.\r\n\r\nOther than shutting down the `Runtime`, is there something else I must do to cleanly close a server? The documentation mentions the concept of \"shutdown\" in passing, but does not elaborate on what must be done to achieve that correctly."},"comment":{"url":"https://api.github.com/repos/hyperium/hyper/issues/comments/405050098","html_url":"https://github.com/hyperium/hyper/issues/1575#issuecomment-405050098","issue_url":"https://api.github.com/repos/hyperium/hyper/issues/1575","id":405050098,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNTA1MDA5OA==","user":{"login":"ChriFo","id":7130686,"node_id":"MDQ6VXNlcjcxMzA2ODY=","avatar_url":"https://avatars0.githubusercontent.com/u/7130686?v=4","gravatar_id":"","url":"https://api.github.com/users/ChriFo","html_url":"https://github.com/ChriFo","followers_url":"https://api.github.com/users/ChriFo/followers","following_url":"https://api.github.com/users/ChriFo/following{/other_user}","gists_url":"https://api.github.com/users/ChriFo/gists{/gist_id}","starred_url":"https://api.github.com/users/ChriFo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChriFo/subscriptions","organizations_url":"https://api.github.com/users/ChriFo/orgs","repos_url":"https://api.github.com/users/ChriFo/repos","events_url":"https://api.github.com/users/ChriFo/events{/privacy}","received_events_url":"https://api.github.com/users/ChriFo/received_events","type":"User","site_admin":false},"created_at":"2018-07-14T21:10:06Z","updated_at":"2018-07-14T21:10:06Z","author_association":"NONE","body":"I have the same behavior with Windows (and Appveyor) and a server implementation based on https://github.com/actix/actix-web which uses tokio. Everything is fine on macOS and Linux (and Travis)!"}}
{"actor":{"display_login":"ChriFo"}}