You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Under the covers, these all call the unix C setsockopt() function
Since setsockopt has a corresponding getsockopt function, I'm proposing that we add the corresponding Getter functions to the net package, looking something like this:
I don't think these are generally useful enough to be worth the complexity they would add to the API. "shouldn't be too difficult" and "could be useful" are a very low bar, much lower than what is required for addition to the standard library. If you'd like to add them to x/net/ipv4 and x/net/ipv6, I guess that's fine.
rsc
changed the title
proposal: net: Implement Getter functions for net <IP/TCP/UDP/Unix>Conn objects
x/net: add Deadline, ReadBuffer, ReadDeadline, WriteBuffer, WriteDeadline getters
Dec 28, 2015
Currently there are the following setter functions in the net package for the IPConn, TCPConn, UDPConn, and UnixConn objects:
Under the covers, these all call the unix C
setsockopt()
functionSince
setsockopt
has a correspondinggetsockopt
function, I'm proposing that we add the corresponding Getter functions to thenet
package, looking something like this:This shouldn't be too difficult to implement, since the generated
zsyscall_*.go
files already have thegetsockopt
function.This could be useful for debugging and logging information, and for checking if the corresponding
Set
function needs to be called.The text was updated successfully, but these errors were encountered: