mirror of
https://github.com/corda/corda.git
synced 2025-06-01 15:10:54 +00:00
Revert reuseaddr
This commit is contained in:
parent
a4d2b28b6b
commit
9836edd191
@ -181,12 +181,10 @@ private fun getTimestampAsDirectoryName(): String {
|
|||||||
fun addressMustBeBound(hostAndPort: HostAndPort) {
|
fun addressMustBeBound(hostAndPort: HostAndPort) {
|
||||||
poll("address $hostAndPort to bind") {
|
poll("address $hostAndPort to bind") {
|
||||||
try {
|
try {
|
||||||
ServerSocket().use {
|
Socket(hostAndPort.hostText, hostAndPort.port).close()
|
||||||
it.bind(InetSocketAddress(hostAndPort.hostText, hostAndPort.port))
|
|
||||||
}
|
|
||||||
null
|
|
||||||
} catch (_exception: SocketException) {
|
|
||||||
Unit
|
Unit
|
||||||
|
} catch (_exception: SocketException) {
|
||||||
|
null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -194,12 +192,10 @@ fun addressMustBeBound(hostAndPort: HostAndPort) {
|
|||||||
fun addressMustNotBeBound(hostAndPort: HostAndPort) {
|
fun addressMustNotBeBound(hostAndPort: HostAndPort) {
|
||||||
poll("address $hostAndPort to unbind") {
|
poll("address $hostAndPort to unbind") {
|
||||||
try {
|
try {
|
||||||
ServerSocket().use {
|
Socket(hostAndPort.hostText, hostAndPort.port).close()
|
||||||
it.bind(InetSocketAddress(hostAndPort.hostText, hostAndPort.port))
|
|
||||||
}
|
|
||||||
Unit
|
|
||||||
} catch (_exception: SocketException) {
|
|
||||||
null
|
null
|
||||||
|
} catch (_exception: SocketException) {
|
||||||
|
Unit
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user