#ifndef WIN32
pthread_cond_signal(&edr->cond);
#else
- // FIXME
+ SetEvent(edr->cond);
#endif
}
}
#ifndef WIN32
pthread_cond_signal(&edr->cond);
#else
- // FIXME
+ SetEvent(edr->cond);
#endif
}
#ifndef WIN32
pthread_cond_wait(&edr->cond, &mutex);
#else
- // FIXME
+ ReleaseMutex(mutex);
+ WaitForSingleObject(edr->cond,INFINITE);
+ WaitForSingleObject(mutex, INFINITE);
+ ResetEvent(edr->cond);
+
#endif
for(i = receivers.begin(); i != receivers.end(); i++)
pthread_cond_init(&edr->cond, NULL);
pthread_cond_wait(&edr->cond, &mutex);
#else
- // FIXME
+ edr->cond = CreateEvent(NULL,/*FALSE*/TRUE,FALSE,NULL);
+ ReleaseMutex(mutex);
+ WaitForSingleObject(edr->cond,INFINITE);
+ ResetEvent(edr->cond);
+ WaitForSingleObject(mutex, INFINITE);
#endif
}
{
nomorecalls = false;
callinprogress = false;
+#ifdef WIN32
+ cond=NULL;
+#endif
}
-
+EDReceiver::~EDReceiver()
+{
+#ifdef WIN32
+ if (cond!=NULL) CloseHandle(cond);
+#endif
+}
public:
EDReceiver();
- virtual ~EDReceiver() {};
+ virtual ~EDReceiver();
protected:
virtual bool call(void* userTag)=0; // Implementor must override this and do the actual call
#ifndef WIN32
pthread_cond_t cond;
#else
- // FIXME
+ HANDLE cond;
#endif
};
continue;
}
-
+ channelID = ntohl(channelID);
+
vresp = new VDR_ResponsePacket();
if (channelID == CHANNEL_REQUEST_RESPONSE)
{
if (!tcp->readData((UCHAR*)&requestID, sizeof(ULONG))) break;
+ requestID = ntohl(requestID);
if (!tcp->readData((UCHAR*)&userDataLength, sizeof(ULONG))) break;
+ userDataLength = ntohl(userDataLength);
if (userDataLength > 5000000) break; // how big can these packets get?
if (userDataLength > 0)
{
else if (channelID == CHANNEL_STREAM)
{
if (!tcp->readData((UCHAR*)&streamID, sizeof(ULONG))) break;
+ streamID = ntohl(streamID);
if (!tcp->readData((UCHAR*)&userDataLength, sizeof(ULONG))) break;
+ userDataLength = ntohl(userDataLength);
if (userDataLength > 0)
{
userData = (UCHAR*)malloc(userDataLength);