forked from Qortal/qortal
Catch UnsupportedAddressTypeException and fall back to IPv4 binding.
This commit is contained in:
parent
3215bb638d
commit
811b647c88
@ -187,7 +187,7 @@ public class Network {
|
|||||||
|
|
||||||
this.bindAddress = bindAddress; // Store the selected address, so that it can be used by other parts of the app
|
this.bindAddress = bindAddress; // Store the selected address, so that it can be used by other parts of the app
|
||||||
break; // We don't want to bind to more than one address
|
break; // We don't want to bind to more than one address
|
||||||
} catch (UnknownHostException e) {
|
} catch (UnknownHostException | UnsupportedAddressTypeException e) {
|
||||||
LOGGER.error("Can't bind listen socket to address {}", Settings.getInstance().getBindAddress());
|
LOGGER.error("Can't bind listen socket to address {}", Settings.getInstance().getBindAddress());
|
||||||
if (i == bindAddresses.size()-1) { // Only throw an exception if all addresses have been tried
|
if (i == bindAddresses.size()-1) { // Only throw an exception if all addresses have been tried
|
||||||
throw new IOException("Can't bind listen socket to address", e);
|
throw new IOException("Can't bind listen socket to address", e);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user