golang udp connection refused on every other write
问题 I ran this UDP client program on ubuntu linux 16.04: package main import ( "fmt" "net" "time" "strconv" ) func CheckError(err error) { if err != nil { fmt.Println("Error: " , err) } } func main() { ServerAddr,err := net.ResolveUDPAddr("udp","127.0.0.1:10001") CheckError(err) LocalAddr, err := net.ResolveUDPAddr("udp", "127.0.0.1:0") CheckError(err) Conn, err := net.DialUDP("udp", LocalAddr, ServerAddr) CheckError(err) defer Conn.Close() i := 0 for { msg := strconv.Itoa(i) i++ buf := []byte