1
0
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:
V2Ray
2015-11-01 21:32:08 +01:00
parent 192960b711
commit 03b8c8f9e8
4 changed files with 40 additions and 22 deletions

View File

@@ -0,0 +1,13 @@
package testing
import (
"sync/atomic"
)
var (
port = int32(30000)
)
func PickPort() uint16 {
return uint16(atomic.AddInt32(&port, 1))
}