Documentation ¶
Overview ¶
Package netutils contains utilities to work with ports and URLs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindUnusedTCPPort ¶
func FindUnusedTCPPort() int
FindUnusedTCPPort finds an unused TCP port by opening a TCP port on an unused port chosen by the operating system, recovering the port number and immediately closing the socket.
This function does not guarantee that multiple calls will return different port numbers, so it might cause tests to flake out. However, the odds of this happening are low. In the future, we might decide to keep track of previously returned port numbers, and keep probing the OS until it returns a previously unseen port number.
func RootDomain ¶
RootDomain returns the root domain, i.e. "perf.skia.org" => "skia.org".
Types ¶
This section is empty.