Skip to content
Snippets Groups Projects
Commit eb4e7da3 authored by akwizgran's avatar akwizgran
Browse files

Interface may be null if there are no suitable network interfaces.

parent f69f6b3d
No related branches found
No related tags found
No related merge requests found
...@@ -250,6 +250,7 @@ class LanTcpPlugin extends TcpPlugin { ...@@ -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 { ...@@ -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) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment