You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
func (us *PushReceiver) getConn() *net.UDPConn {
for i := 0; i < 3; i++ {
r := rand.New(rand.NewSource(time.Now().UnixNano()))
port := r.Intn(1000) + 54951
us.port = port
conn, ok := us.tryListen()
if ok {
logger.Infof("udp server start, port: " + strconv.Itoa(port))
return conn
}
if !ok && i == 2 {
logger.Errorf("failed to start udp server after trying 3 times.")
}
}
return nil
}
Hello, I have looked at nacos-Go-SDK, in his SDK there is an extra handling of ports, the code is as follows:
The text was updated successfully, but these errors were encountered: