I want to read a socket's error queue and cannot find a way to do that
for an UDPConn.
I am trying to implement a traceroute-like utility in Go. In order to
do that I would like to open an UDP socket, send some packets, and
read the error queue of the socket. At least on Linux, the last is
achieved by recvmsg(MSG_ERRQUEUE) on a socket that had IP_RECVERR flag
set. There are two problems with this approach: UDPConn.ReadMsgUDP
doesn't allow one to pass flags to runtime.Recvmsg (it always passes
0) and I'm not sure if setting IP_RECVERR on a duplicate fd (returned
by UDPConn.File()) would have the desired effect.
I don't know if other operating systems implement a mechanism to
retrieve errors in some similar fashion (recvmsg(MSG_ERRQUEUE) isn't
in Posix and in fact, it doesn't seem to say anything about error
queues), but I'd assume it'd be significantly different.
It seems that in order to solve my problem on Linux without any
modifications to Go, I would need to use syscall package directly and
either do a lot of blocking syscalls or use a separate instance of
some kind of poll server. Would adding a way to call ReadMsg with
flags be reasonable?
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firstname.lastname@example.org.
For more options, visit https://groups.google.com/groups/opt_out.