Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Checker ¶
Checker is used to check for available ports on a host.
func NewChecker ¶
NewChecker returns a Checker that can check ports on the given host.
func (*Checker) AvailableRange ¶
AvailableRange asks the operating system for ports until it is given a contiguous range of ports size long. It returns the first and last of those port numbers, having released all the ports it took, so they are ready for you to use.
NB: there is the potential for a race condition here, where once released, another process gets one of the ports before you use it, so start listening on all the returned ports as soon as possible after calling this.
Click to show internal directories.
Click to hide internal directories.