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

Add dial timeout #3

Closed
wants to merge 2 commits into from
Closed

Add dial timeout #3

wants to merge 2 commits into from

Conversation

practice-golang
Copy link

Some service provider block personal ip address and some do not give any response.
In my case, naver.com act as waiting villain.

Copy link
Owner

@nilslice nilslice left a comment

Choose a reason for hiding this comment

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

Good idea! To accept this PR, I would prefer that the timeout is passed in to Send, via a context.

Please let me know if you disagree. I'm imagining that you'd set up your Message, then your context.WithTimeout, and then call msg.Send(ctx), where your dialTimeout func gets the timeout from the context.

You could alternatively add a separate method SendContext(ctx) so there is no API change.

@practice-golang
Copy link
Author

Hello @nilslice , sorry for late response.
Ok, I will PR again

@practice-golang
Copy link
Author

practice-golang commented Nov 7, 2018

Hello @nilslice , I requested PR again, could you please check this?

BTW, I'm not sure which is better using context or using variable(not a struct).
I'v tried to wrap context definition code into SendContext function but did not work.

Thank you 😄

@nilslice
Copy link
Owner

Hi, I'm closing this after opening a new PR using your branch as a base. See #4 for more details. Thank you!

@nilslice nilslice closed this Nov 11, 2018
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