Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllocateTCPPort ¶
AllocateTCPPort allocates a TCP port on the looopback address, and starts a temporary listener on it. That listener is returned to the caller alongside with the allocated port number. The listener must be closed right before the port is used by the caller. This naturally still leaves a race condition window where that port number might be snatched up by some other process, but there doesn't seem to be a better way to do this.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.