1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-11-19 19:06:43 -05:00
v2fly/common/net/testing/port.go

16 lines
208 B
Go
Raw Normal View History

2015-11-01 15:32:08 -05:00
package testing
import (
"sync/atomic"
2015-12-02 15:44:01 -05:00
v2net "github.com/v2ray/v2ray-core/common/net"
2015-11-01 15:32:08 -05:00
)
var (
port = int32(30000)
)
2015-12-02 15:44:01 -05:00
func PickPort() v2net.Port {
return v2net.Port(uint16(atomic.AddInt32(&port, 1)))
2015-11-01 15:32:08 -05:00
}