Do not attempt EventServer connection via IPv6
EventServer only listens on IPv4 addresses, even if the machine running kodi has IPv6 support (the webserver on the other hand does listen on both IPv4 and IPv6). fixes #148
This commit is contained in:
parent
f701280840
commit
2c369ef63f
|
@ -26,6 +26,7 @@ import org.xbmc.kore.jsonrpc.HostConnection;
|
||||||
import org.xbmc.kore.jsonrpc.method.Application;
|
import org.xbmc.kore.jsonrpc.method.Application;
|
||||||
import org.xbmc.kore.jsonrpc.type.ApplicationType;
|
import org.xbmc.kore.jsonrpc.type.ApplicationType;
|
||||||
import org.xbmc.kore.utils.LogUtils;
|
import org.xbmc.kore.utils.LogUtils;
|
||||||
|
import org.xbmc.kore.utils.NetUtils;
|
||||||
import org.xbmc.kore.utils.Utils;
|
import org.xbmc.kore.utils.Utils;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -97,7 +98,7 @@ public class EventServerConnection {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
hostInetAddress = InetAddress.getByName(hostInfo.getAddress());
|
hostInetAddress = NetUtils.getInet4AddressByName(hostInfo.getAddress());
|
||||||
} catch (UnknownHostException exc) {
|
} catch (UnknownHostException exc) {
|
||||||
LogUtils.LOGD(TAG, "Got an UnknownHostException, disabling EventServer");
|
LogUtils.LOGD(TAG, "Got an UnknownHostException, disabling EventServer");
|
||||||
hostInetAddress = null;
|
hostInetAddress = null;
|
||||||
|
@ -164,7 +165,7 @@ public class EventServerConnection {
|
||||||
// Get the InetAddress
|
// Get the InetAddress
|
||||||
final InetAddress hostInetAddress;
|
final InetAddress hostInetAddress;
|
||||||
try {
|
try {
|
||||||
hostInetAddress = InetAddress.getByName(hostInfo.getAddress());
|
hostInetAddress = NetUtils.getInet4AddressByName(hostInfo.getAddress());
|
||||||
} catch (UnknownHostException exc) {
|
} catch (UnknownHostException exc) {
|
||||||
LogUtils.LOGD(TAG, "Couldn't get host InetAddress");
|
LogUtils.LOGD(TAG, "Couldn't get host InetAddress");
|
||||||
reportTestResult(callerHandler, callerCallback, false);
|
reportTestResult(callerHandler, callerCallback, false);
|
||||||
|
|
Loading…
Reference in New Issue