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

net: DialContextTCP() #21231

Closed
gobwas opened this issue Jul 31, 2017 · 6 comments

Comments

Projects
None yet
4 participants
@gobwas
Copy link

commented Jul 31, 2017

Hello! I've search for some similar issues and found this one but looks like it is stale now.

My issue points to inability to dial via tcp with custom context.Context passed.

Current implementation of net.DialTCP() (actually net.dialTCP) is absolutely ready to receive context for dial, but has no exported wrapper that can receive it.

@fraenkel

This comment has been minimized.

Copy link
Contributor

commented Jul 31, 2017

@gobwas

This comment has been minimized.

Copy link
Author

commented Jul 31, 2017

@fraenkel no.

conn, err := dialer.DialContext(...)

Does not allow me to setup local address for connection.

@fraenkel

This comment has been minimized.

Copy link
Contributor

commented Jul 31, 2017

Sure it can. Set the LocalAddress in the Dialer.

@gobwas

This comment has been minimized.

Copy link
Author

commented Jul 31, 2017

@fraenkel wow. Thanks! Seems like I really missed this. 👍
By the way, should the net.DialContextTCP() appear?

@fraenkel

This comment has been minimized.

Copy link
Contributor

commented Jul 31, 2017

I don't think so. We just need to adequately highlight the proper APIs that people should use. The original ones were modified to leverage the Context based ones but cannot be removed for compatibility reasons.

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

commented Aug 1, 2017

Closing since there doesn't seem to be anything to do here.

@golang golang locked and limited conversation to collaborators Aug 1, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.