|
|
@@ -15,7 +15,6 @@ const int MAX_INIT_TIMES = 5;
|
|
|
// Termainal Performance Counter Component [Josephus in 9:31:27 2016/4/23]
|
|
|
CONST ULONG COUNTER_INTERVAL_MS = 1000;
|
|
|
|
|
|
-const char * AvailMemoryQuery = "\\Memory\\Available MBytes";
|
|
|
const char * HandleNumQuery = "\\Process(_Total)\\Handle Count";
|
|
|
const char * ThreadNumQuery = "\\Process(_Total)\\Thread Count";
|
|
|
const char * ProcessNumQuery = "\\System\\Processes";
|
|
|
@@ -1129,20 +1128,14 @@ void HeartBeatConnection::SendHandShake()
|
|
|
//oiltest
|
|
|
//strcpy(req.TerminalNo,"75500000002");
|
|
|
|
|
|
- //Dbg("get sysvar");
|
|
|
//oiltest set default value
|
|
|
CSimpleStringA warningLevel("w"),runState("O"),customerHandle("c"),callState("s"),
|
|
|
localMaintain("l"),remoteMaintain("m"),termStage("U");
|
|
|
- //m_pEntity->GetFunction()->GetSysVar("WarningLevel",warningLevel);
|
|
|
|
|
|
strncpy(req.TerminalNo,m_TerminalNo.GetData(),m_TerminalNo.GetLength());
|
|
|
- //m_pEntity->GetFunction()->GetSysVar("RunState",runState);
|
|
|
m_pEntity->GetFunction()->GetSysVar("CustomerHandle",customerHandle);
|
|
|
m_pEntity->GetFunction()->GetSysVar("CallState",callState);
|
|
|
- //m_pEntity->GetFunction()->GetSysVar("LocalMaintain",localMaintain);
|
|
|
- //m_pEntity->GetFunction()->GetSysVar("RemoteMaintain",remoteMaintain);
|
|
|
m_pEntity->GetFunction()->GetSysVar("TerminalStage",termStage);
|
|
|
- //Dbg("ts[%s]",(LPCTSTR)termStage);
|
|
|
//oiltest byteorder
|
|
|
#ifdef RVC_OS_WIN
|
|
|
char tmp[256];
|
|
|
@@ -1198,56 +1191,8 @@ void HeartBeatConnection::SendHandShake()
|
|
|
//oilyang@20171122 数量太多,暂时去掉
|
|
|
//Dbg("Get Terminal Performance Information suc");
|
|
|
}
|
|
|
- //const char* szIP = m_pFSM->GetRealIP();
|
|
|
- //memset(tmp, 0, sizeof(tmp));
|
|
|
- //strcpy_s(tmp, 256, szIP);
|
|
|
- //Dbg("Calling gethostbyname with %s %s", tmp, szIP);
|
|
|
- //ent = gethostbyname(tmp);
|
|
|
- //ip = 0xffffffff;
|
|
|
- //if (ent == NULL)
|
|
|
- //{
|
|
|
- // DWORD dwError = WSAGetLastError();
|
|
|
- // if (dwError != 0)
|
|
|
- // {
|
|
|
- // if (dwError == WSAHOST_NOT_FOUND)
|
|
|
- // {
|
|
|
- // Dbg("Host not found");
|
|
|
- // } else if (dwError == WSANO_DATA)
|
|
|
- // {
|
|
|
- // Dbg("No data record found");
|
|
|
- // } else
|
|
|
- // {
|
|
|
- // Dbg("Function failed with error: %ld", dwError);
|
|
|
- // }
|
|
|
- // }
|
|
|
- // counter.serverIP = 0xffffffff;
|
|
|
- //}
|
|
|
- //else
|
|
|
- //{
|
|
|
- // //unsigned long ulIP = ((struct in_addr*)ent->h_addr)->S_un.S_addr;
|
|
|
- // for (int i = 0; ent->h_addr_list[i]; ++i)
|
|
|
- // {
|
|
|
- // if (ent->h_addrtype == AF_INET)
|
|
|
- // {
|
|
|
- // struct in_addr *in = (struct in_addr*)ent->h_addr_list[i];
|
|
|
- // if (in->S_un.S_un_b.s_b1 != 0)
|
|
|
- // {
|
|
|
- // if (in->S_un.S_un_b.s_b1 == 192)
|
|
|
- // continue;
|
|
|
- // ip = (in->S_un.S_un_b.s_b1<<24)+(in->S_un.S_un_b.s_b2<<16)
|
|
|
- // +(in->S_un.S_un_b.s_b3<<8)+in->S_un.S_un_b.s_b4;
|
|
|
- // // test for ip with S_addr [Josephus in 11:15:43 2016/4/22]
|
|
|
- // unsigned long ulIP = in->S_un.S_addr;
|
|
|
- // unsigned long ul2IP = inet_addr(tmp);
|
|
|
- // Dbg("joseph-test2: ip=0x%x, ulIp=0x%x, ul2IP=0x%x", ip, ulIP, ul2IP);
|
|
|
- // break;
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
- //}
|
|
|
|
|
|
counter.serverIP = m_pFSM->m_dwServIP;
|
|
|
- //Dbg("dwServIP 0x%x", counter.serverIP);
|
|
|
#ifdef RVC_OS_WIN
|
|
|
const char* diskPath = m_pFSM->GetRunDiskPath();
|
|
|
ULARGE_INTEGER uliFreeBytesAvailable;
|
|
|
@@ -1284,6 +1229,8 @@ void HeartBeatConnection::SendCardActive(const int type,const int slot,unsigned
|
|
|
m_pEntity->GetFunction()->GetSystemStaticInfo(sysSInfo);
|
|
|
req.type = type;
|
|
|
req.slot = slot;
|
|
|
+
|
|
|
+ //TODO: CrossPlaform [Gifur@2025630]
|
|
|
#ifdef RVC_OS_WIN
|
|
|
strncpy_s(req.FromTerminalNo, m_TerminalNo.GetData(), m_TerminalNo.GetLength());
|
|
|
strncpy_s(req.Account, account, accSize);
|
|
|
@@ -1311,6 +1258,8 @@ void HeartBeatConnection::SendCardActive(const int type,const int slot,unsigned
|
|
|
req.findCard = findCard;
|
|
|
req.cardPos = cardPos;
|
|
|
req.reserved1 = errCSCode;
|
|
|
+
|
|
|
+ //TODO: CrossPlaform [Gifur@2025630]
|
|
|
#ifdef RVC_OS_WIN
|
|
|
strncpy_s(req.FromTerminalNo, m_TerminalNo.GetData(), m_TerminalNo.GetLength());
|
|
|
strncpy_s(req.Account, account, accSize);
|
|
|
@@ -1408,10 +1357,9 @@ void HeartBeatConnection::PkgRcvProcHandAndInstruc(const CSmartPointer<IPackage>
|
|
|
}
|
|
|
}
|
|
|
else {
|
|
|
- Dbg("invalid handshakeans packet!");
|
|
|
- //OnDisconnect();
|
|
|
+ DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("invalid handshakeans packet!");
|
|
|
}
|
|
|
- delete pBuf;
|
|
|
+ delete [] pBuf;
|
|
|
}
|
|
|
}
|
|
|
|