- if (IsOpen())
- {
- DWORD iTimeout((DWORD)iTimeoutMs);
- if (iTimeout != iTimeoutMs)
- return -1;
-
- int iError(0);
- if (!SetTimeouts(m_socket, &iError, iTimeout))
- return -1;
-
- return SerialSocketRead(m_socket, &m_iError, data, len, iTimeoutMs);
- }
+ DWORD dwTimeoutMs((DWORD)iTimeoutMs);
+ if (iTimeoutMs != (uint64_t)iTimeoutMs)
+ dwTimeoutMs = MAXDWORD;