Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Signal handling works only once #183

Closed
khvzak opened this issue Mar 2, 2023 · 1 comment
Closed

Signal handling works only once #183

khvzak opened this issue Mar 2, 2023 · 1 comment

Comments

@khvzak
Copy link
Contributor

khvzak commented Mar 2, 2023

Imagine the following code:

#[ntex::main]
async fn main() {
    // Srv1
    ntex::web::HttpServer::new(|| ntex::web::App::new())
        .bind("0.0.0.0:8081")
        .unwrap()
        .run()
        .await
        .unwrap();

    // Srv2
    ntex::web::HttpServer::new(|| ntex::web::App::new())
        .bind("0.0.0.0:8081")
        .unwrap()
        .run()
        .await
        .unwrap();
}

The first server can be stopped just fine by pressing ctrl-c/sending signal, but the next one would ignore the same signal and never stop.

fafhrd91 added a commit that referenced this issue Mar 11, 2023
fafhrd91 added a commit that referenced this issue Mar 11, 2023
@fafhrd91
Copy link
Member

fixed in master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants