CL 37037, which refurbishes the required socket system calls and puts them into a new internal/socket package,
CL 37038, which glues APIs in the internal/socket package on the internal/poll package,
CL 37039, which makes internal APIs in the net package visible to the x/net repository by using the "//go:linkname" directive.
A summary for the changes to x/net repository:
CL 37035, which wraps the bridged internal APIs,
CL 37036, which fixes the breakage of ipv4 package,
CL 37042, which fixes the breakage of ipv6 package.
Considering https://github.com/golang/go/issues/17244, I think it's reasonable that the internal APIs in the net package are only visible to the x/net repository for now.
More generally, this e-mail describes the solution without describing
the problem. Could you describe the problem first? I don't think I
fully understand it. Once we know the problem, we'll be able to
evaluate the solution.
--
You received this message because you are subscribed to the Google Groups "golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To me, this suggests that the internal/poll package should do the kind
of thing that the runtime package does: define an accessor function
and use go:linkname to put them in the appropriate golang.org/x/net
package. It's also OK to put the go:linkname over on the
golang.org/x/net side if that seems cleaner.
Of course I agree that ....
Of course I agree that ....then, shall we start to reivew cl 37038-37039 and 37035, 37036, 37042 and 37417?
I still don't see the purpose of the internal/socket package.
From your description of the problem, I don't see why we don't just
need to add one or two functions to the net package.
Exposing incref and decref looks like a big mess to me.
Suppose we instead add a new method on net.conn:
I would personally be OK with making this an exported API but I would
like to hear other opinions.
Would that help with the net package? What else would the net package need?
--
I'm still uncomfortable with the raw-ness of this API,
--
I'm confused about why you think it is preferable to add whole new packages instead of this.
"NOTE: This package is locked down. Code outside the standard Go
repository should be migrated to use the corresponding package in the
golang.org/x/sys repository. That is also where updates required by new
systems or versions should be applied. See
https://golang.org/s/go1.4-syscall for more information.
I'm confused about why you think it is preferable to add whole new packages instead of this.it's because of the docs"NOTE: This package is locked down. Code outside the standard Go
repository should be migrated to use the corresponding package in the
golang.org/x/sys repository. That is also where updates required by new
systems or versions should be applied. See
https://golang.org/s/go1.4-syscall for more information.
simply, i'm still not sure whether it's good to add new apis into the locked down package even if there's a rationale for it. the stated issues in go1.4-syscall are pretty right. i suppose that once we add new stuff into the syscall package it probably may start to call surrounding unordered functionality and makes the package more hard to maintain (and that's the reason why i added a few x/net packages and vendored them for supporting multiple kernel abi views instead of struggling with the syscall package.)
anyway, i'm fine with your proposal because it also meets my requirements for fixing #19051. if there's no objection i'll start to review a new series of cls based on your proposal.
by the way, it looks like #10565 has been blocked by the same root cause; what's the good api across over the net and syscall packages. do you have any opinion about the required api? i guess that one approach would be to make it possible to register a socket descriptor into the runtime-integrated network poller via the net package like the following:package net// this satisfies net.Conn, net.PacketConn and syscall.Conn interfaces.type rawconn struct { fd *poll.FD }func RawConn(uintptr) (Conn, error)func RawPacketConn(uintptr) (PacketConn, error)
I would still like to see syscall.RegisterSocket like in the discussions in #15021. Then plain net.FileConn can be used.