Skip to content

Commit

Permalink
optimize code (#471) (#484)
Browse files Browse the repository at this point in the history
  • Loading branch information
stulzq authored Jul 5, 2022
1 parent bcceb19 commit 24e67a3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion clients/naming_client/push_receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,9 @@ func (us *PushReceiver) tryListen() (*net.UDPConn, bool) {
}

func (us *PushReceiver) getConn() *net.UDPConn {
r := rand.New(rand.NewSource(time.Now().UnixNano()))

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()
Expand Down

0 comments on commit 24e67a3

Please sign in to comment.