mirror of https://github.com/qwqdanchun/nps.git
fix:bind local udp port error causes program to crash
This commit is contained in:
parent
1be9e5472f
commit
dc9eea6cc7
|
@ -216,12 +216,12 @@ func (s *TRPClient) handleChan(src net.Conn) {
|
|||
func (s *TRPClient) handleUdp(serverConn net.Conn) {
|
||||
// bind a local udp port
|
||||
local, err := net.ListenUDP("udp", nil)
|
||||
defer local.Close()
|
||||
defer serverConn.Close()
|
||||
if err != nil {
|
||||
logs.Error("bind local udp port error ", err.Error())
|
||||
return
|
||||
}
|
||||
defer local.Close()
|
||||
go func() {
|
||||
defer serverConn.Close()
|
||||
b := common.BufPoolUdp.Get().([]byte)
|
||||
|
|
Loading…
Reference in New Issue