Browse Source

Fix udp goroutine leak

v.conn.link.Reader is a pipe.Reader, doesn't implement Close(), it will fail assertion and cause the pipe to be left open
It can be fixed by using Interrupt()
isluckys 1 year ago
parent
commit
89074a14b6
1 changed files with 1 additions and 1 deletions
  1. 1 1
      transport/internet/udp/dispatcher.go

+ 1 - 1
transport/internet/udp/dispatcher.go

@@ -45,7 +45,7 @@ func (v *Dispatcher) RemoveRay() {
 	v.Lock()
 	defer v.Unlock()
 	if v.conn != nil {
-		common.Close(v.conn.link.Reader)
+		common.Interrupt(v.conn.link.Reader)
 		common.Close(v.conn.link.Writer)
 		v.conn = nil
 	}