golang.org/x/net/ipv4 windows support

164 views
Skip to first unread message

bar...@gmail.com

unread,
Aug 18, 2016, 11:33:24 AM8/18/16
to golang-nuts
Does anyone know what it would take to implement the windows ControlMessage functions for the golang.org/x/net/ipv4 package? I am using the ipv4 package to specify the outgoing interface index of UDP requests. The following example works correctly on linux but fails with not supported by windows (https://play.golang.org/p/n8Q9xPxINn):


l := ipv4.NewPacketConn(conn)
if err = l.SetControlMessage(ipv4.FlagInterface, true); err != nil {
log.Printf("Unable to set control message %s", err)
} else {
log.Printf("set ipv4.FlagInterface success")
}

Thanks

Matt Harden

unread,
Aug 20, 2016, 11:08:54 AM8/20/16
to bar...@gmail.com, golang-nuts
The relevant socket option seems to be supported in Windows: https://msdn.microsoft.com/en-us/library/windows/desktop/hh285668(v=vs.85).aspx

--
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 golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

mikioh...@gmail.com

unread,
Aug 20, 2016, 9:51:24 PM8/20/16
to golang-nuts
Reply all
Reply to author
Forward
0 new messages