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

Comments

Projects
None yet
5 participants
@lmb
Copy link
Contributor

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

@gopherbot gopherbot added the Proposal label Sep 27, 2017

@golang golang deleted a comment from gopherbot Oct 2, 2017

@rsc

This comment has been minimized.

Copy link
Contributor

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

This comment has been minimized.

Copy link

commented Oct 2, 2017

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

@rsc

This comment has been minimized.

Copy link
Contributor

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

This comment has been minimized.

Copy link
Contributor Author

commented Oct 16, 2017

@lmb

This comment has been minimized.

Copy link
Contributor Author

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

This comment has been minimized.

Copy link
Contributor

commented Oct 18, 2017

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

@gopherbot

This comment has been minimized.

Copy link

commented Oct 18, 2017

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

@gopherbot gopherbot closed this in eed308d Oct 25, 2017

@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.
You can’t perform that action at this time.