mirror of
https://github.com/golang/go
synced 2024-11-12 06:30:21 -07:00
Added a method on UDPConn so they can actually send broadcast packets.
R=rsc https://golang.org/cl/162046
This commit is contained in:
parent
a85c258e67
commit
229807c8c3
@ -71,7 +71,11 @@ type UDPConn struct {
|
||||
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 }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user