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:
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user