By default the AvailablePortIterator assumes a developer wants to protect ports on the local host adapter. However developers often use the provided ports on adapters other than the local host. eg: on a multi-homed machine
Consequently there is the possibility on a multi-home machine (and certain operating systems) that a port "reserved" on the local host (or 127.0.0.1) may not be available on (or already in use) on another adapter.
We need to change the default behavior of the AvailablePortIterator to ensure that it opens ServerSockets on 0.0.0.0 (or the IPv6 equivalent), instead of using "local host".
By default the AvailablePortIterator assumes a developer wants to protect ports on the local host adapter. However developers often use the provided ports on adapters other than the local host. eg: on a multi-homed machine
Consequently there is the possibility on a multi-home machine (and certain operating systems) that a port "reserved" on the local host (or 127.0.0.1) may not be available on (or already in use) on another adapter.
We need to change the default behavior of the AvailablePortIterator to ensure that it opens ServerSockets on 0.0.0.0 (or the IPv6 equivalent), instead of using "local host".