Skip to content

Commit

Permalink
split initialization of receive function
Browse files Browse the repository at this point in the history
  • Loading branch information
lspgn committed May 19, 2024
1 parent 04b6181 commit 7f450b6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions utils/udp.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,11 @@ func (r *UDPReceiver) receive(addr string, port int, started chan bool) error {
if !ok {
return err
}

return r.receiveRoutine(udpconn)
}

func (r *UDPReceiver) receiveRoutine(udpconn *net.UDPConn) (err error) {
localAddr, _ := udpconn.LocalAddr().(*net.UDPAddr)

for {
Expand Down

0 comments on commit 7f450b6

Please sign in to comment.