mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-20 03:23:07 +00:00
Add more logging for exceptions.
This commit is contained in:
parent
125bcb370f
commit
022866288d
@ -479,9 +479,10 @@ public class Game extends Activity implements OnGenericMotionListener, OnTouchLi
|
||||
}
|
||||
|
||||
@Override
|
||||
public void connectionTerminated() {
|
||||
public void connectionTerminated(Exception e) {
|
||||
if (!displayedFailureDialog) {
|
||||
displayedFailureDialog = true;
|
||||
e.printStackTrace();
|
||||
Dialog.displayDialog(this, "Connection Terminated", "The connection failed unexpectedly", true);
|
||||
conn.stop();
|
||||
}
|
||||
|
@ -141,7 +141,7 @@ public class NvAudioStream {
|
||||
try {
|
||||
packet = packets.take();
|
||||
} catch (InterruptedException e) {
|
||||
listener.connectionTerminated();
|
||||
listener.connectionTerminated(e);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -166,7 +166,7 @@ public class NvAudioStream {
|
||||
try {
|
||||
samples = depacketizer.getNextDecodedData();
|
||||
} catch (InterruptedException e) {
|
||||
listener.connectionTerminated();
|
||||
listener.connectionTerminated(e);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -192,7 +192,7 @@ public class NvAudioStream {
|
||||
try {
|
||||
rtp.receive(packet);
|
||||
} catch (IOException e) {
|
||||
listener.connectionTerminated();
|
||||
listener.connectionTerminated(e);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -228,14 +228,14 @@ public class NvAudioStream {
|
||||
try {
|
||||
rtp.send(pingPacket);
|
||||
} catch (IOException e) {
|
||||
listener.connectionTerminated();
|
||||
listener.connectionTerminated(e);
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
Thread.sleep(100);
|
||||
} catch (InterruptedException e) {
|
||||
listener.connectionTerminated();
|
||||
listener.connectionTerminated(e);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -205,6 +205,7 @@ public class NvConnection {
|
||||
break;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
success = false;
|
||||
}
|
||||
|
||||
@ -231,7 +232,7 @@ public class NvConnection {
|
||||
hostAddr = InetAddress.getByName(host);
|
||||
} catch (UnknownHostException e) {
|
||||
displayToast(e.getMessage());
|
||||
listener.connectionTerminated();
|
||||
listener.connectionTerminated(e);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -261,7 +262,7 @@ public class NvConnection {
|
||||
try {
|
||||
inputStream.sendMouseMove(deltaX, deltaY);
|
||||
} catch (IOException e) {
|
||||
listener.connectionTerminated();
|
||||
listener.connectionTerminated(e);
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -278,7 +279,7 @@ public class NvConnection {
|
||||
try {
|
||||
inputStream.sendMouseButtonDown();
|
||||
} catch (IOException e) {
|
||||
listener.connectionTerminated();
|
||||
listener.connectionTerminated(e);
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -295,7 +296,7 @@ public class NvConnection {
|
||||
try {
|
||||
inputStream.sendMouseButtonUp();
|
||||
} catch (IOException e) {
|
||||
listener.connectionTerminated();
|
||||
listener.connectionTerminated(e);
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -317,7 +318,7 @@ public class NvConnection {
|
||||
rightTrigger, leftStickX, leftStickY,
|
||||
rightStickX, rightStickY);
|
||||
} catch (IOException e) {
|
||||
listener.connectionTerminated();
|
||||
listener.connectionTerminated(e);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -26,5 +26,5 @@ public interface NvConnectionListener {
|
||||
public void stageFailed(Stage stage);
|
||||
|
||||
public void connectionStarted();
|
||||
public void connectionTerminated();
|
||||
public void connectionTerminated(Exception e);
|
||||
}
|
||||
|
@ -234,8 +234,8 @@ public class NvControl implements ConnectionStatusListener {
|
||||
{
|
||||
try {
|
||||
sendHeartbeat();
|
||||
} catch (IOException e1) {
|
||||
listener.connectionTerminated();
|
||||
} catch (IOException e) {
|
||||
listener.connectionTerminated(e);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -243,7 +243,7 @@ public class NvControl implements ConnectionStatusListener {
|
||||
try {
|
||||
Thread.sleep(3000);
|
||||
} catch (InterruptedException e) {
|
||||
listener.connectionTerminated();
|
||||
listener.connectionTerminated(e);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -261,15 +261,15 @@ public class NvControl implements ConnectionStatusListener {
|
||||
{
|
||||
try {
|
||||
sendJitter();
|
||||
} catch (IOException e1) {
|
||||
listener.connectionTerminated();
|
||||
} catch (IOException e) {
|
||||
listener.connectionTerminated(e);
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
Thread.sleep(100);
|
||||
} catch (InterruptedException e) {
|
||||
listener.connectionTerminated();
|
||||
listener.connectionTerminated(e);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -198,7 +198,7 @@ public class NvVideoStream {
|
||||
try {
|
||||
du = depacketizer.getNextDecodeUnit();
|
||||
} catch (InterruptedException e) {
|
||||
listener.connectionTerminated();
|
||||
listener.connectionTerminated(e);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -224,7 +224,7 @@ public class NvVideoStream {
|
||||
try {
|
||||
packet = packets.take();
|
||||
} catch (InterruptedException e) {
|
||||
listener.connectionTerminated();
|
||||
listener.connectionTerminated(e);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -251,7 +251,7 @@ public class NvVideoStream {
|
||||
try {
|
||||
rtp.receive(packet);
|
||||
} catch (IOException e) {
|
||||
listener.connectionTerminated();
|
||||
listener.connectionTerminated(e);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -287,14 +287,14 @@ public class NvVideoStream {
|
||||
try {
|
||||
rtp.send(pingPacket);
|
||||
} catch (IOException e) {
|
||||
listener.connectionTerminated();
|
||||
listener.connectionTerminated(e);
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
Thread.sleep(100);
|
||||
} catch (InterruptedException e) {
|
||||
listener.connectionTerminated();
|
||||
listener.connectionTerminated(e);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user