Be more like a library to support mobile (#247)

This commit is contained in:
Nathan Brown
2020-06-30 13:48:58 -05:00
committed by GitHub
parent 1ea8847085
commit 41578ca971
21 changed files with 477 additions and 69 deletions

View File

@@ -32,3 +32,12 @@ func NewListenConfig(multi bool) net.ListenConfig {
},
}
}
func (u *udpConn) Rebind() error {
file, err := u.File()
if err != nil {
return err
}
return syscall.SetsockoptInt(int(file.Fd()), unix.IPPROTO_IP, unix.IP_BOUND_IF, 0)
}