node-driver: Use anyAddress for RandomFree port allication

This commit is contained in:
Andras Slemmer 2016-09-05 17:29:44 +01:00
parent 9836edd191
commit d8ae07e771

View File

@ -94,7 +94,7 @@ sealed class PortAllocation {
class RandomFree(): PortAllocation() {
override fun nextPort(): Int {
return ServerSocket().use {
it.bind(InetSocketAddress("localhost", 0))
it.bind(InetSocketAddress(0))
it.localPort
}
}