Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetFreePort ¶
GetFreePort opens a TCP listener on a randomly selected available port. It returns the listener and the selected port number.
func IsPortFree ¶
IsPortFree checks if a given TCP port is free to bind to. It takes into account specifics of
MacOS behavior where multiple IP versions (IPv4 and IPv6) may be bound to the same port, which can lead to false positives in port availability checking. IsPortFree able to work this around by checking both ip versions for the port, to give a unified behaviour across different platforms.
If you wish to check both TCP and UDP networks, then give a zero value to the Network argument.
Types ¶
Click to show internal directories.
Click to hide internal directories.