mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2025-08-18 09:25:49 +00:00
Merge branch 'master' of github.com:limelight-stream/limelight-common-c
This commit is contained in:
commit
2493c04019
@ -54,7 +54,7 @@ static void UdpPingThreadProc(void *context) {
|
|||||||
err = sendto(rtpSocket, pingData, sizeof(pingData), 0, (struct sockaddr*)&saddr, sizeof(saddr));
|
err = sendto(rtpSocket, pingData, sizeof(pingData), 0, (struct sockaddr*)&saddr, sizeof(saddr));
|
||||||
if (err != sizeof(pingData)) {
|
if (err != sizeof(pingData)) {
|
||||||
Limelog("UDP ping thread terminating #1\n");
|
Limelog("UDP ping thread terminating #1\n");
|
||||||
listenerCallbacks->connectionTerminated(err);
|
listenerCallbacks->connectionTerminated(LastSocketError());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,7 +77,7 @@ static void ReceiveThreadProc(void* context) {
|
|||||||
if (err <= 0) {
|
if (err <= 0) {
|
||||||
Limelog("Receive thread terminating #2\n");
|
Limelog("Receive thread terminating #2\n");
|
||||||
free(buffer);
|
free(buffer);
|
||||||
listenerCallbacks->connectionTerminated(err);
|
listenerCallbacks->connectionTerminated(LastSocketError());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -149,6 +149,7 @@ static void jitterThreadFunc(void* context) {
|
|||||||
static void resyncThreadFunc(void* context) {
|
static void resyncThreadFunc(void* context) {
|
||||||
long long payload[2];
|
long long payload[2];
|
||||||
NVCTL_PACKET_HEADER header;
|
NVCTL_PACKET_HEADER header;
|
||||||
|
PNVCTL_PACKET_HEADER response;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
header.type = PTYPE_RESYNC;
|
header.type = PTYPE_RESYNC;
|
||||||
@ -174,6 +175,14 @@ static void resyncThreadFunc(void* context) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
response = readNvctlPacket();
|
||||||
|
if (response == NULL) {
|
||||||
|
Limelog("Resync thread terminating #3\n");
|
||||||
|
listenerCallbacks->connectionTerminated(LastSocketError());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Limelog("Resync complete\n");
|
||||||
|
|
||||||
PltClearEvent(&resyncEvent);
|
PltClearEvent(&resyncEvent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,18 +9,6 @@
|
|||||||
#define SetLastSocketError(x) WSASetLastError(x)
|
#define SetLastSocketError(x) WSASetLastError(x)
|
||||||
#define LastSocketError() WSAGetLastError()
|
#define LastSocketError() WSAGetLastError()
|
||||||
|
|
||||||
#ifdef LC_WINDOWS_PHONE
|
|
||||||
#undef WINAPI_FAMILY
|
|
||||||
#define WINAPI_FAMILY WINAPI_FAMILY_DESKTOP_APP
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <WinSock2.h>
|
|
||||||
|
|
||||||
#ifdef LC_WINDOWS_PHONE
|
|
||||||
#undef WINAPI_FAMILY
|
|
||||||
#define WINAPI_FAMILY WINAPI_FAMILY_PHONE_APP
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
@ -66,7 +66,7 @@ static void UdpPingThreadProc(void *context) {
|
|||||||
err = sendto(rtpSocket, pingData, sizeof(pingData), 0, (struct sockaddr*)&saddr, sizeof(saddr));
|
err = sendto(rtpSocket, pingData, sizeof(pingData), 0, (struct sockaddr*)&saddr, sizeof(saddr));
|
||||||
if (err != sizeof(pingData)) {
|
if (err != sizeof(pingData)) {
|
||||||
Limelog("UDP ping thread terminating #1\n");
|
Limelog("UDP ping thread terminating #1\n");
|
||||||
listenerCallbacks->connectionTerminated(err);
|
listenerCallbacks->connectionTerminated(LastSocketError());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -89,7 +89,7 @@ static void ReceiveThreadProc(void* context) {
|
|||||||
if (err <= 0) {
|
if (err <= 0) {
|
||||||
Limelog("Receive thread terminating #2\n");
|
Limelog("Receive thread terminating #2\n");
|
||||||
free(buffer);
|
free(buffer);
|
||||||
listenerCallbacks->connectionTerminated(err);
|
listenerCallbacks->connectionTerminated(LastSocketError());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user