mirror of
https://github.com/moonlight-stream/moonlight-ios.git
synced 2026-06-17 14:11:35 +00:00
Display failing ports when connection fails
This commit is contained in:
@@ -365,8 +365,8 @@
|
|||||||
- (void)connectionTerminated:(int)errorCode {
|
- (void)connectionTerminated:(int)errorCode {
|
||||||
Log(LOG_I, @"Connection terminated: %d", errorCode);
|
Log(LOG_I, @"Connection terminated: %d", errorCode);
|
||||||
|
|
||||||
unsigned int portTestResults = LiTestClientConnectivity(CONN_TEST_SERVER, 443,
|
unsigned int portFlags = LiGetPortFlagsFromTerminationErrorCode(errorCode);
|
||||||
LiGetPortFlagsFromTerminationErrorCode(errorCode));
|
unsigned int portTestResults = LiTestClientConnectivity(CONN_TEST_SERVER, 443, portFlags);
|
||||||
|
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
// Allow the display to go to sleep now
|
// Allow the display to go to sleep now
|
||||||
@@ -387,7 +387,12 @@
|
|||||||
|
|
||||||
case ML_ERROR_NO_VIDEO_TRAFFIC:
|
case ML_ERROR_NO_VIDEO_TRAFFIC:
|
||||||
title = @"Connection Error";
|
title = @"Connection Error";
|
||||||
message = @"No video received from host. Check the host PC's firewall and port forwarding rules.";
|
message = @"No video received from host.";
|
||||||
|
if (portFlags != 0) {
|
||||||
|
char failingPorts[256];
|
||||||
|
LiStringifyPortFlags(portFlags, "\n", failingPorts, sizeof(failingPorts));
|
||||||
|
message = [message stringByAppendingString:[NSString stringWithFormat:@"\n\nCheck your firewall and port forwarding rules for port(s):\n%s", failingPorts]];
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ML_ERROR_NO_VIDEO_FRAME:
|
case ML_ERROR_NO_VIDEO_FRAME:
|
||||||
@@ -439,6 +444,11 @@
|
|||||||
[UIApplication sharedApplication].idleTimerDisabled = NO;
|
[UIApplication sharedApplication].idleTimerDisabled = NO;
|
||||||
|
|
||||||
NSString* message = [NSString stringWithFormat:@"%s failed with error %d", stageName, errorCode];
|
NSString* message = [NSString stringWithFormat:@"%s failed with error %d", stageName, errorCode];
|
||||||
|
if (portTestFlags != 0) {
|
||||||
|
char failingPorts[256];
|
||||||
|
LiStringifyPortFlags(portTestFlags, "\n", failingPorts, sizeof(failingPorts));
|
||||||
|
message = [message stringByAppendingString:[NSString stringWithFormat:@"\n\nCheck your firewall and port forwarding rules for port(s):\n%s", failingPorts]];
|
||||||
|
}
|
||||||
if (portTestResults != ML_TEST_RESULT_INCONCLUSIVE && portTestResults != 0) {
|
if (portTestResults != ML_TEST_RESULT_INCONCLUSIVE && portTestResults != 0) {
|
||||||
message = [message stringByAppendingString:@"\n\nYour device's network connection is blocking Moonlight. Streaming may not work while connected to this network."];
|
message = [message stringByAppendingString:@"\n\nYour device's network connection is blocking Moonlight. Streaming may not work while connected to this network."];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user