mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-12-27 20:45:28 -05:00
Port picker
This commit is contained in:
13
common/net/testing/port.go
Normal file
13
common/net/testing/port.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package testing
|
||||
|
||||
import (
|
||||
"sync/atomic"
|
||||
)
|
||||
|
||||
var (
|
||||
port = int32(30000)
|
||||
)
|
||||
|
||||
func PickPort() uint16 {
|
||||
return uint16(atomic.AddInt32(&port, 1))
|
||||
}
|
||||
Reference in New Issue
Block a user