INNER CODE UNIT · Go
main
kube-vip/kube-vip · demo/client/main.go:13
func main() {
address := flag.String("address", "127.0.0.1", "The address of the server")
port := flag.Int("port", 10002, "the port of the server")
interval := flag.Float64("interval", 1000, "Interval in milliseconds")
flag.Parse()
var errorTime time.Time
var errorOccurred bool
for {
p := make([]byte, 2048)
conn, err := net.Dial("udp", net.JoinHostPort(*address, fmt.Sprint(port)))
if err != nil {
if !errorOccurred {
errorTime = time.Now()
errorOccurred = true
}
continue
}