Documentation ¶
Overview ¶
Package portal (Port Allocator) provides a helper for reserving free TCP ports across multiple processes on the same machine. This works by asking the kernel for available ports in the ephemeral port range. It does so by binding to an address with port 0 (e.g. 127.0.0.1:0), modifying the socket to disable SO_LINGER, close the connection, and finally return the port that was used. This *probably* works well, because the kernel re-uses ports in an LRU fashion, implying the test code asking for the ports *should* be the only thing immediately asking to bind that port again.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FatalTester ¶
Click to show internal directories.
Click to hide internal directories.