mirror of
https://github.com/fumiama/WireGold.git
synced 2026-06-21 19:13:20 +08:00
parallel listen
This commit is contained in:
@@ -18,7 +18,7 @@ func (m *Me) listen() (conn *net.UDPConn, err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
var mu sync.Mutex
|
var mu sync.Mutex
|
||||||
for i := 0; i < runtime.NumCPU(); i++ {
|
for i := 0; i < runtime.NumCPU()*4; i++ {
|
||||||
go m.listenthread(conn, &mu)
|
go m.listenthread(conn, &mu)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user