我是套接字编程的新手,我们在网络上有一个正在运行的 MFC 客户端应用程序,由于某种原因,它的套接字每天至少断断续续地断开一次。这不是网络问题,因为其他网络应用程序运行良好。然而,我注意到日志中的一些内容,在套接字断开连接之前或多或少 10 分钟发生了数据库错误。就像是 :
DB ERROR: ADO Error 1 (s)
select l.LABOID, l.LABOCODE, l.LABOCREDATE, l.LABOTEXT, l.SHORTTEXT, l.LISACCOUNTINGMODE, l.ADDRESS1, l.ADDRESS2, l.POSTALCODE, l.CITY, l.STATE, l.COUNTRY, the . TELEPHON, l.FAX, l.EMAIL, l.TELEPHON2, l.NATIONALCODE, l.FIRSTITEMID, l.ALTERNATECODE, l.LABOSERVICEID, l.STARTVALIDDATE, l.ENDVALIDDATE, l.LOGUSERID, l.LOGDATE, b.DICBINARYID , b.OBJECTLINK, b.OBJECTTYPE, b.DICBINARYTYPE, b.BINARYDATE, b.BINARYMIMETYPE, b.BINARYSIZE, b.LOGUSERID, b.LOGDATE, b.BINARYOBJECT, (select count (*) from d DICT_LABO_TO_DEVICE Where l.LABOID = d.LABOID) as NB_DEVICES from DICT_LABORATORIES l, b DICT_BINARY_DATA Where l.ENDVALIDDATE is null and l.LABOCODE like '%%' and l.LABOID b.OBJECTLINK = (+) and b.DICBINARYTYPE (+) = 1 and b . OBJECTTYPE (+) = 7 AND LABOID IN (1) order by l.LABOCODE
ORA-00936: missing expression of
Error: 0x80040e14
在调试模式下,我发现线程仍在运行但未连接套接字。我无法确定是什么导致它断开连接。是否建议重新连接? 这是代码块:
if (m_pClientSocket->IsThreadStillRunning())
{
if(m_pClientSocket->m_boSocketConnected)
{
dwNbSent_L = *pdwBufferSize_P;
m_pClientSocket->Write(pbyBuffer_P, *pdwBufferSize_P);
iotResult_L = IOTRANS_RESULT_SUCCESS;
}
else
{
m_pobjSession->Write(MSG_ERROR,TRACE_LOW
,_T("%s Client socket is not connected")
,(LPCTSTR)m_strLastErrFunc);
iotResult_L = IOTRANS_RESULT_FAILED;
SetError(ERROR_SOCKET_NOT_CONNECTED, _T("Client socket is not connected"), m_strLastErrFunc);
}
}
谁能给我一个快速启动或检查项目列表以防止这种情况发生?