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

Use boxed AsyncUdpSocket when creating abstract endpoint #1595

Merged
merged 2 commits into from
Jun 30, 2023

Conversation

tthebst
Copy link
Contributor

@tthebst tthebst commented Jun 29, 2023

Wrapping the std socket with either TokioRuntime or AsyncStdRuntime returns Box<dyn AsyncUdpSocket>. Creating an endpoint with an abstract socket requires impl AsyncUdpSocket and it is therefore not possible to use a wrapped socket together with new_with_abstract_socket.

This MR fixes this inconsistency by using Box<dyn AsyncUdpSocket> in new_with_abstract_socket.

quinn/src/endpoint.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@Ralith Ralith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@Ralith Ralith merged commit a8c17a3 into quinn-rs:main Jun 30, 2023
}

fn new_with_runtime(
fn new_with_abstract_socket(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Um, this replaced the public constructor with only a private one. That doesn't seem like the right direction?

Copy link
Contributor Author

@tthebst tthebst Jun 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ops. Sorry my bad. #1596

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be fair, it's also @Ralith's bad for not catching it in review! Thanks for following up.

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

Successfully merging this pull request may close these issues.

3 participants