Open zmt opened 10 months ago
@neild @ianlancetaylor per owners.
It sounds as though you are asking for a change to the exported API of the net package, which is typically something that would require proposal review (see proposing changes.
@neild @ianlancetaylor per owners.
It sounds as though you are asking for a change to the exported API of the net package, which is typically something that would require proposal review (see proposing changes.
Strictly speaking, yes, it is a change to the exported API. However, it is in the netutil
package from the golang.org/x/net
module. My understanding is that /x
path prefix indicates "experimental". I wasn't clear if that would require a formal proposal to change an experimental package, so I started with a simple issue, including the proposed patch content.
@thanm from the proposing changes:
Note: A non-proposal issue can be turned into a proposal by simply adding the proposal label.
Please add the label if you think it is appropriate. I am unable to do so myself.
Go version
go1.21.5
What operating system and processor architecture are you using (
go env
)?What did you do?
I was attempting to use the https://pkg.go.dev/golang.org/x/net/netutil#LimitListener to wrap the
*net.UnixListener
in listener_posix.go to limit connection acceptance at a theshold caclulated as a percentage of https://pkg.go.dev/syscall#Rlimit. Thepeertracker
code needs to assert the underlying*net.UnixConn
type here.I tested out a proposed fix using a local filesystem replace directive to code with this patch:
What did you expect to see?
I expected to be able to get at the underlying
*net.UnixConn
after wrapping with thenetutil.LimitListener
.What did you see instead?
The
limitListenerConn
was unexported so I couldn't assert the type of the embeddednet.Conn
.