OSDN Git Service

2012/01/21 22:28:40
authorqwerty2501 <riot313@gmail.com>
Sat, 21 Jan 2012 13:28:40 +0000 (22:28 +0900)
committerqwerty2501 <riot313@gmail.com>
Sat, 21 Jan 2012 13:28:40 +0000 (22:28 +0900)
nlib/nlib_nicoLive.c
nlite.suo

index 4671d11..5237840 100644 (file)
@@ -121,7 +121,7 @@ static BOOL NicoLiveRecvChatLoop(NicoLiveStream_P self);
 ///
 ///\83\8b\81[\83v
 ///
-static unsigned int loopCommon(NicoLiveStream_P self,WSAEVENT sendEvent,WSAEVENT resetEvent ,NicoLiveOnSend nicoLiveOnSend);
+static unsigned int loopCommon(NicoLiveStream_P self,WSAEVENT sendEvent,WSAEVENT resetEvent ,NicoLiveOnSend nicoLiveOnSend,LPDWORD time);
 
 ///
 ///\83R\83\81\83\93\83g\89ð\90Í\8aÖ\90\94
@@ -317,8 +317,9 @@ VOID NicoLiveStream_delete(NicoLiveStream_P* self){
 ///
 VOID NicoLiveStream_setHeartBeatMsec(NicoLiveStream_P self,DWORD msec){
 
-       WSASetEvent(self->chatManager.setHeartBeatTimeEvent);
+       
        self->chatManager.heartBeatTime  = msec;
+       WSASetEvent(self->chatManager.setHeartBeatTimeEvent);
        return;
 }
 
@@ -358,9 +359,9 @@ BOOL NicoLiveStream_getHeartBeatFlag(NicoLiveStream_P self){
 ///
 VOID NicoLiveStream_setKeapALiveMsec(NicoLiveStream_P self,DWORD msec){
 
-       WSASetEvent(self->chatManager.setKeepAliveTimeEvent);
+       
        self->chatManager.keepAliveTime = msec;
-
+       WSASetEvent(self->chatManager.setKeepAliveTimeEvent);
        return;
 
 }
@@ -1274,7 +1275,7 @@ static unsigned int WINAPI  NicoLiveKeapALiveThread(void* lpBuffer){
 
        NicoLiveStream_P self = (NicoLiveStream_P)lpBuffer;
 
-       rslt = loopCommon(self,self->chatManager.setKeepAliveTimeEvent,self->chatManager.resetEvents[2],self->chatManager.onKeepAlliveSend);
+       rslt = loopCommon(self,self->chatManager.setKeepAliveTimeEvent,self->chatManager.resetEvents[2],self->chatManager.onKeepAlliveSend,&self->chatManager.keepAliveTime);
 
        _endthreadex(rslt);
 
@@ -1288,7 +1289,7 @@ static unsigned int WINAPI  NicoLiveHeartBeatThread(void* lpBuffer){
        NicoLiveStream_P self = (NicoLiveStream_P)lpBuffer;
 
 
-       rslt = loopCommon(self,self->chatManager.setHeartBeatTimeEvent,self->chatManager.resetEvents[1],self->chatManager.onHeartBeatSend);
+       rslt = loopCommon(self,self->chatManager.setHeartBeatTimeEvent,self->chatManager.resetEvents[1],self->chatManager.onHeartBeatSend,&self->chatManager.heartBeatTime);
 
 
 
@@ -1296,7 +1297,7 @@ static unsigned int WINAPI  NicoLiveHeartBeatThread(void* lpBuffer){
 
        return rslt;
 }
-static unsigned int loopCommon(NicoLiveStream_P self,WSAEVENT sendEvent,WSAEVENT resetEvent ,NicoLiveOnSend nicoLiveOnSend){
+static unsigned int loopCommon(NicoLiveStream_P self,WSAEVENT sendEvent,WSAEVENT resetEvent ,NicoLiveOnSend nicoLiveOnSend,LPDWORD time){
 
        unsigned int rslt = 0;
        WSAEVENT events[3] = {self->chatManager.deleteEvent,self->chatManager.startEvent,self->chatManager.endEvent};   //\83C\83x\83\93\83g\94z\97ñ
@@ -1340,7 +1341,7 @@ restart:
 
                while(TRUE){
                        WSAResetEvent(sendEvent);
-                       endResult = WSAWaitForMultipleEvents(sizeof(streamEvent) / sizeof(streamEvent[0]),streamEvent,FALSE,self->chatManager.heartBeatTime,FALSE);
+                       endResult = WSAWaitForMultipleEvents(sizeof(streamEvent) / sizeof(streamEvent[0]),streamEvent,FALSE,*time,FALSE);
 
                        if(endResult == WSA_WAIT_TIMEOUT){
 
index e521e7d..929804f 100644 (file)
Binary files a/nlite.suo and b/nlite.suo differ