mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-15 20:29:52 +01:00
Interface may be null if there are no suitable network interfaces.
This commit is contained in:
@@ -250,6 +250,7 @@ class LanTcpPlugin extends TcpPlugin {
|
|||||||
ServerSocket ss = null;
|
ServerSocket ss = null;
|
||||||
try {
|
try {
|
||||||
InetAddress iface = chooseInterface();
|
InetAddress iface = chooseInterface();
|
||||||
|
if(iface == null) return null;
|
||||||
ss = new ServerSocket();
|
ss = new ServerSocket();
|
||||||
ss.bind(new InetSocketAddress(iface, 0));
|
ss.bind(new InetSocketAddress(iface, 0));
|
||||||
} catch(IOException e) {
|
} catch(IOException e) {
|
||||||
@@ -261,6 +262,7 @@ class LanTcpPlugin extends TcpPlugin {
|
|||||||
MulticastSocket ms = null;
|
MulticastSocket ms = null;
|
||||||
try {
|
try {
|
||||||
InetAddress iface = chooseInterface();
|
InetAddress iface = chooseInterface();
|
||||||
|
if(iface == null) return null;
|
||||||
ms = new MulticastSocket();
|
ms = new MulticastSocket();
|
||||||
ms.setInterface(iface);
|
ms.setInterface(iface);
|
||||||
} catch(IOException e) {
|
} catch(IOException e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user