-
-
Notifications
You must be signed in to change notification settings - Fork 408
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
How to reject incoming connections after quinn 0.9? #1584
Comments
So we had |
I would be happy to! |
Closes quinn-rs#1584 This commit adds a new function that refuses new connections without impacting existing connections. Internally, this just sets the connection limit to 0, which causes incoming connections to be rejected. This is the same approach that was taken in 0.8.5 when `Incoming` was dropped.
Closes quinn-rs#1584 This commit adds a new function that refuses new connections without impacting existing connections. Internally, this just sets the connection limit to 0, which causes incoming connections to be rejected. This is the same approach that was taken in 0.8.5 when `Incoming` was dropped.
Closes quinn-rs#1584 This commit adds a new function that refuses new connections without impacting existing connections. Internally, this just sets the connection limit to 0, which causes incoming connections to be rejected. This is the same approach that was taken in 0.8.5 when `Incoming` was dropped.
This functionality actually already exists: via |
Once I saw how this was implemented, I thought about that, but it didn't feel very ergonomic. Since Endpoint doesn't give an accessor to read the server config, it would require consumers to keep a copy of their server config around. |
I'd prefer to address an ergonomic shortfall there than to set a precedent of duplicating |
That's really only half of the problem. I'm happy to accept that as a solution. I'm also happy to accept no changes at all, now that I understand how to accomplish this use case. The problem for other users is discoverability of this functionality. With the current pull request, an approach to do a graceful shutdown of a server connection is clearly available. Without a dedication function, the flow of how to shutdown incoming connections isn't very clear, even if access to the server config is provided. I'd at a minimum suggest documenting this flow as part of From a usability standpoint, I personally would prefer a dedicated function and the accessor, rather than just one or the other. Since I can technically do this today by storing my server config, I'll be updating the library without needing a new release. That means I really don't mind whichever approach is chosen -- I'm unblocked :) |
It's a fair point that this is a uniquely important/common pattern compared to other config changes, and I'm open to proceeding with the change on that basis. Will follow up in the PR. |
I'm trying to upgrade a library that uses quinn under the hood, and the library previously offered the ability to close incoming connections to enable a way to gracefully shut down a server. This worked in 0.8 by passing the
Incoming
stream into its own task, and stopping that task onceclose_incoming
was called. This dropped theIncoming
type, which caused incoming connections to be refused.In quinn 0.9 and later,
Endpoint::server
no longer returns anIncoming
type, and theEndpoint
now has anaccept()
function instead. All of my attempts to prevent incoming connections have not worked: either the incoming connection is accepted before being terminated or the connection hangs rather than being refused.Is there a way to preserve the functionality we were utilizing in 0.8 in the current version? Thank you, and apologies if I missed something in the docs for how to handle this!
The text was updated successfully, but these errors were encountered: