mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2026-06-22 00:31:09 +00:00
Improve logging for control stream connection failure
This commit is contained in:
+11
-3
@@ -1203,9 +1203,17 @@ int startControlStream(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Wait for the connect to complete
|
// Wait for the connect to complete
|
||||||
if (serviceEnetHost(client, &event, CONTROL_STREAM_TIMEOUT_SEC * 1000) <= 0 ||
|
err = serviceEnetHost(client, &event, CONTROL_STREAM_TIMEOUT_SEC * 1000);
|
||||||
event.type != ENET_EVENT_TYPE_CONNECT) {
|
if (err <= 0 || event.type != ENET_EVENT_TYPE_CONNECT) {
|
||||||
Limelog("Failed to connect to UDP port %u\n", ControlPortNumber);
|
if (err < 0) {
|
||||||
|
Limelog("Failed to establish ENet connection on UDP port %u: error %d\n", ControlPortNumber, LastSocketFail());
|
||||||
|
}
|
||||||
|
else if (err == 0) {
|
||||||
|
Limelog("Failed to establish ENet connection on UDP port %u: timed out\n", ControlPortNumber);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Limelog("Failed to establish ENet connection on UDP port %u: unexpected event %d (error: %d)\n", ControlPortNumber, event.type, LastSocketError());
|
||||||
|
}
|
||||||
stopping = true;
|
stopping = true;
|
||||||
enet_peer_reset(peer);
|
enet_peer_reset(peer);
|
||||||
peer = NULL;
|
peer = NULL;
|
||||||
|
|||||||
Reference in New Issue
Block a user