mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2026-02-16 10:30:59 +00:00
Improve ENet socket error propagation for better debuggability
This commit is contained in:
@@ -144,7 +144,7 @@ static bool transactRtspMessageEnet(PRTSP_MESSAGE request, PRTSP_MESSAGE respons
|
||||
// Wait for a reply
|
||||
if (serviceEnetHost(client, &event, RTSP_RECEIVE_TIMEOUT_SEC * 1000) <= 0 ||
|
||||
event.type != ENET_EVENT_TYPE_RECEIVE) {
|
||||
Limelog("Failed to receive RTSP reply\n");
|
||||
Limelog("Failed to receive RTSP reply: %d\n", LastSocketFail());
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ static bool transactRtspMessageEnet(PRTSP_MESSAGE request, PRTSP_MESSAGE respons
|
||||
// The payload comes in a second packet
|
||||
if (serviceEnetHost(client, &event, RTSP_RECEIVE_TIMEOUT_SEC * 1000) <= 0 ||
|
||||
event.type != ENET_EVENT_TYPE_RECEIVE) {
|
||||
Limelog("Failed to receive RTSP reply payload\n");
|
||||
Limelog("Failed to receive RTSP reply payload: %d\n", LastSocketFail());
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
@@ -851,7 +851,7 @@ int performRtspHandshake(PSERVER_INFORMATION serverInfo) {
|
||||
// Wait for the connect to complete
|
||||
if (serviceEnetHost(client, &event, RTSP_CONNECT_TIMEOUT_SEC * 1000) <= 0 ||
|
||||
event.type != ENET_EVENT_TYPE_CONNECT) {
|
||||
Limelog("RTSP: Failed to connect to UDP port %u\n", RtspPortNumber);
|
||||
Limelog("RTSP: Failed to connect to UDP port %u: error %d\n", RtspPortNumber, LastSocketFail());
|
||||
enet_peer_reset(peer);
|
||||
peer = NULL;
|
||||
enet_host_destroy(client);
|
||||
|
||||
Reference in New Issue
Block a user