1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-01-01 23:15:21 -05:00

move tcp.PickPort to its own package

This commit is contained in:
Darien Raymond
2018-03-01 11:53:39 +01:00
parent a7d467992d
commit af29e42771
14 changed files with 94 additions and 85 deletions

View File

@@ -5,6 +5,7 @@ import (
"v2ray.com/core/common/net"
)
// PickPort returns an unused UDP port in the system. The port returned is highly likely to be unused, but not guaranteed.
func PickPort() net.Port {
conn, err := net.ListenUDP("udp4", &net.UDPAddr{
IP: net.LocalHostIP.IP(),