Commit 229807c8 authored by Jonathan Wills's avatar Jonathan Wills Committed by Russ Cox

Added a method on UDPConn so they can actually send broadcast packets.

R=rsc
https://golang.org/cl/162046
parent a85c258e
...@@ -71,7 +71,11 @@ type UDPConn struct { ...@@ -71,7 +71,11 @@ type UDPConn struct {
fd *netFD; fd *netFD;
} }
func newUDPConn(fd *netFD) *UDPConn { return &UDPConn{fd} } func newUDPConn(fd *netFD) *UDPConn {
c := &UDPConn{fd};
setsockoptInt(fd.fd, syscall.SOL_SOCKET, syscall.SO_BROADCAST, 1);
return c;
}
func (c *UDPConn) ok() bool { return c != nil && c.fd != nil } func (c *UDPConn) ok() bool { return c != nil && c.fd != nil }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment