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

feat: add new method get_uri for Endpoint #371

Merged
merged 1 commit into from
Jun 16, 2020

Conversation

Sherlock-Holo
Copy link
Contributor

This PR adds a new method get_uri for Endpoint, to allow user to get the &Uri from an Endpoint

Motivation

I am using tonic and stored the Endpoint, ensure I can reconnect GRPC server directly, however sometimes I need to get the uri in Endpoint to print some log.

One way is to create a wrapper struct Endpoint(Uri, tonic::transport::Endpoint), but it will allocate a new Uri.

I think the better way is let Endpoint can return the Uri reference which is in the Endpoint, user can use it to print logs or do something else, without unnecessary allocating.

related issue is #370

@Sherlock-Holo
Copy link
Contributor Author

the failed test makes me confused, I don't modify related codes.

Is there anyone who could tell me how to solve this problem? :(

@LucioFranco
Copy link
Member

The error seems like a race condition with the OS letting go of the previous socket to allow the new one to bind. I reran the test to see if that fixes it.

@Sherlock-Holo
Copy link
Contributor Author

the test is passed, thanks for your help :)

Copy link
Member

@LucioFranco LucioFranco left a comment

Choose a reason for hiding this comment

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

Thanks!

@LucioFranco LucioFranco merged commit 54d7a7a into hyperium:master Jun 16, 2020
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.

2 participants