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

proposal: net: add Control-only SyscallConn to Listeners #22065

Closed
lmb opened this issue Sep 27, 2017 · 7 comments
Closed

proposal: net: add Control-only SyscallConn to Listeners #22065

lmb opened this issue Sep 27, 2017 · 7 comments

Comments

@lmb
Copy link
Contributor

lmb commented Sep 27, 2017

Go 1.9 added RawConn to some net.Conns, allowing access to the OS' FD. It seems like a similar function could be added to Listeners.

We have a use case where we'd like to set a sockopt on a TCPListener, which could be simplified by being able to call TCPListener.RawConn (or similar) with the same semantics as for net.Conn.

cc @mikioh (?)

@gopherbot gopherbot added this to the Proposal milestone Sep 27, 2017
@golang golang deleted a comment from gopherbot Oct 2, 2017
@rsc
Copy link
Contributor

rsc commented Oct 2, 2017

So maybe *net.TCPListener etc should have a SyscallConn that returns a syscall.RawConn for which Read and Write return errors, but Control works? That seems like enough, and without hardly any new API.

@pavel-odintsov
Copy link

Yep, that's enough for us. We just need some reliable interface to specify our custom SetSockOpt options.

@rsc
Copy link
Contributor

rsc commented Oct 16, 2017

OK, let's do #22065 (comment)

@rsc rsc changed the title proposal: net: Add RawConn to Listeners where appropriate proposal: net: add Control-only SyscallConn to Listeners Oct 16, 2017
@lmb
Copy link
Contributor Author

lmb commented Oct 16, 2017 via email

@lmb
Copy link
Contributor Author

lmb commented Oct 18, 2017

I have a CL, but currently can't figure out how to use the corporate CLA that is already in place.

@ianlancetaylor
Copy link
Contributor

Send me the CLA details offline (iant@golang.org) and I'll see if I can get it figured out. Thanks.

@gopherbot
Copy link

Change https://golang.org/cl/71651 mentions this issue: net: make {TCP,UDP}Listener implement syscall.Conn

@golang golang locked and limited conversation to collaborators Oct 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants