fix: socket异常退出捕获,停止信号退出循环读取

This commit is contained in:
TsMask
2025-05-30 14:12:43 +08:00
parent 1f2a2b687d
commit 0ff3c469fc
4 changed files with 16 additions and 3 deletions

View File

@@ -27,7 +27,7 @@ func (c *ConnUDP) New() (*ConnUDP, error) {
proto = "udp6"
c.Addr = fmt.Sprintf("[%s]", c.Addr)
}
address := fmt.Sprintf("%s:%d", c.Addr, c.Port)
address := net.JoinHostPort(c.Addr, fmt.Sprint(c.Port))
// 默认等待5s
if c.DialTimeOut == 0 {