2011-8-12 11:18:04
this0->m_sRegChannel[0].bOnline = false;
this0->m_sRegChannel[1].bOnline = false;
//停止监听
closesocket(this0->m_listenSocket);
//关闭socket
EnterCriticalSection(&this0->m_csLockSocket);
std::map<SOCKET, int>::iterator iterSocket = this0->m_mapSocketInfo.begin();
while (iterSocket != this0->m_mapSocketInfo.end())
{
closesocket(iterSocket->first);
this0->m_mapSocketInfo.erase(iterSocket++);
}
LeaveCriticalSection(&this0->m_csLockSocket);
for(int i=0; i<AMP_ENCODER_MAX_CHANNUM; i++)
{
this0->m_channel[i].StopReceive();
}
this0->m_bListen = false;
心跳检测认为断了
断了手机端没有显示
手机端10s的alive时间
需要维护一个login的ID 和一个通道的信息
就在device中添加就可以了
如果是重复打开
就直接
EnterCriticalSection(&this0->m_channel[lpReqTCP->iChannel-1].m_csVideoSocket);
this0->m_channel[lpReqTCP->iChannel-1].m_setVideoSendSocket.insert(acceptsocket);
LeaveCriticalSection(&this0->m_channel[lpReqTCP->iChannel-1].m_csVideoSocket);
外面在查询状态
DWORD MainManager::QueryDeviceStatus(LONG lHandle, BOOL &bIsOnline)
{
EnterCriticalSection(&m_csLockDevice);
MAP_VIRTUAL_DEVICE::iterator iterDeviceInfo = m_mapDevice.find(lHandle);
if(iterDeviceInfo != m_mapDevice.end())
0x000010d0 4304 占了设备锁
EnterCriticalSection(&m_channel[0].m_csVideoSocket);
0x0000181c 占了socket锁 6172
215 Id: 3848.28f0 Suspend: 1 Teb: 7fed4000 Unfrozen
ChildEBP RetAddr Args to Child
1d01fecc 7c92df4a 7c809590 00000002 1d01fef8 ntdll!KiFastSystemCallRet
1d01fed0 7c809590 00000002 1d01fef8 00000001 ntdll!ZwWaitForMultipleObjects+0xc
1d01ff6c 7c80a115 00000002 1d01ffa4 00000000 kernel32!WaitForMultipleObjectsEx+0x12c
1d01ff88 72c9312a 00000002 1d01ffa4 00000000 kernel32!WaitForMultipleObjects+0x18
1d01ffb4 7c80b729 00000000 0018a6e0 0018a6e8 wdmaud!MixerCallbackThread+0x42
1d01ffec 00000000 72c930e8 00000000 00000000 kernel32!BaseThreadStart+0x37
216 Id: 3848.12a4 Suspend: 1 Teb: 7fed3000 Unfrozen
ChildEBP RetAddr Args to Child
1d11ff1c 7c92df5a 7c8025db 00000144 00000000 ntdll!KiFastSystemCallRet
1d11ff20 7c8025db 00000144 00000000 00000000 ntdll!ZwWaitForSingleObject+0xc
1d11ff84 7c802542 00000144 ffffffff 00000000 kernel32!WaitForSingleObjectEx+0xa8
1d11ff98 72c945e9 00000144 ffffffff 00000000 kernel32!WaitForSingleObject+0x12
1d11ffb4 7c80b729 00000144 00000000 00000000 wdmaud!waveThread+0x6e
1d11ffec 00000000 72c9457b 00180df0 00000000 kernel32!BaseThreadStart+0x37
217 Id: 3848.1ad8 Suspend: 1 Teb: 7fed2000 Unfrozen
ChildEBP RetAddr Args to Child
1d21fe68 7c98e139 1d21fe84 7c98e576 0017def8 ntdll!DbgBreakPoint+0x1
1d21fe70 7c98e576 0017def8 00140000 00000001 ntdll!RtlpBreakPointHeap+0x28
1d21fe84 7c98fa1d 00140000 0017def8 7c98fadc ntdll!RtlpValidateHeapEntry+0x113
1d21fed4 7c96d281 00140000 50000061 0017df00 ntdll!RtlDebugGetUserInfoHeap+0x96
1d21ff38 7c834d23 00140000 00000001 0017df00 ntdll!RtlGetUserInfoHeap+0x3a
1d21ff84 72c922ce 0017df00 7c9210e0 7c921000 kernel32!GlobalHandle+0x3a
1d21ff9c 72c94617 00181110 00000000 00000000 wdmaud!waveCompleteHeader+0x40
1d21ffb4 7c80b729 00000128 00000000 00000000 wdmaud!waveThread+0x9c
1d21ffec 00000000 72c9457b 00181110 00000000 kernel32!BaseThreadStart+0x37
218 Id: 3848.25dc Suspend: 1 Teb: 7fed1000 Unfrozen
ChildEBP RetAddr Args to Child
1d31ff1c 7c92df5a 7c8025db 00000194 00000000 ntdll!KiFastSystemCallRet
1d31ff20 7c8025db 00000194 00000000 00000000 ntdll!ZwWaitForSingleObject+0xc
1d31ff84 7c802542 00000194 ffffffff 00000000 kernel32!WaitForSingleObjectEx+0xa8
1d31ff98 72c945e9 00000194 ffffffff 00000000 kernel32!WaitForSingleObject+0x12
1d31ffb4 7c80b729 00000194 00000000 00000000 wdmaud!waveThread+0x6e
1d31ffec 00000000 72c9457b 00175360 00000000 kernel32!BaseThreadStart+0x37
219 Id: 3848.878 Suspend: 1 Teb: 7fed0000 Unfrozen
ChildEBP RetAddr Args to Child
1d41ff1c 7c92df5a 7c8025db 00000108 00000000 ntdll!KiFastSystemCallRet
1d41ff20 7c8025db 00000108 00000000 00000000 ntdll!ZwWaitForSingleObject+0xc
1d41ff84 7c802542 00000108 ffffffff 00000000 kernel32!WaitForSingleObjectEx+0xa8
1d41ff98 72c945e9 00000108 ffffffff 00000000 kernel32!WaitForSingleObject+0x12
1d41ffb4 7c80b729 00000108 00000000 00000000 wdmaud!waveThread+0x6e
1d41ffec 00000000 72c9457b 00175008 00000000 kernel32!BaseThreadStart+0x37