update
This commit is contained in:
parent
8b3d4f1d03
commit
70600ed9a5
@ -1092,6 +1092,11 @@ BOOLEAN CHostADSBFProcess::readRealData()
|
||||
|
||||
AdsVariable<std::array<BYTE, MAX_BLOCKF_SIZE>> turbineData {*m_turbine, ADSIGRP_IOIMAGE_RWOB, m_adsOverviewDataMemAddr};
|
||||
pData = ((std::array<BYTE, MAX_BLOCKF_SIZE>)turbineData).data();
|
||||
if (!m_turbine->IsConnected())
|
||||
{
|
||||
vLog(LOG_ERROR, "%s Read data error.\n", m_pidName.c_str());
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
WORD registerAddr = m_adsOverviewDataMemAddr;
|
||||
|
||||
|
5
das-dn/third_party/AdsLib/Sockets.cpp
vendored
5
das-dn/third_party/AdsLib/Sockets.cpp
vendored
@ -153,6 +153,7 @@ Socket::Socket(const struct addrinfo* const host, const int type) :
|
||||
|
||||
Socket::~Socket()
|
||||
{
|
||||
LOG_ERROR("destroy socket\n");
|
||||
Shutdown();
|
||||
// closesocket(m_Socket);
|
||||
|
||||
@ -218,7 +219,7 @@ size_t Socket::read(uint8_t* buffer, size_t maxBytes, timeval* timeout)
|
||||
}
|
||||
m_LastError = WSAGetLastError();
|
||||
if ((0 == bytesRead) || (m_LastError == CONNECTION_CLOSED) || (m_LastError == CONNECTION_ABORTED)) {
|
||||
LOG_INFO("Socket connection closed by remote with error: " << std::dec << std::strerror(m_LastError));
|
||||
LOG_INFO("read error, Socket: " << m_Socket << " connection closed by remote with error: " << std::dec << std::strerror(m_LastError));
|
||||
} else {
|
||||
LOG_ERROR("Socket read frame failed with error: " << std::dec << std::strerror(m_LastError));
|
||||
}
|
||||
@ -289,7 +290,7 @@ size_t Socket::write(const Frame& frame)
|
||||
}
|
||||
|
||||
if(0 == len){
|
||||
LOG_INFO("Socket connection closed by remote with error: " << std::dec << std::strerror(m_LastError));
|
||||
LOG_INFO("write error, Socket: " << m_Socket << " connection closed by remote with error: " << std::dec << std::strerror(m_LastError));
|
||||
Shutdown();
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user