Opened 22 years ago
Last modified 22 years ago
#248 closed Bug report
CAsyncSocketEx::IOCtl() returns wrong result
Reported by: | mrdoubleyou | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | Other |
Keywords: | Cc: | mrdoubleyou, Tim Kosse | |
Component version: | Operating system type: | ||
Operating system version: |
Description
The return value of CAsyncSocketEx::IOCtl() should be
inverted.
CAsyncSocketEx::IOCtl() calls ioctlsocket() which
returns 0 if success, and SOCKET_ERROR if not
success.
CAsyncSocketEx::IOCtl() therefore should return TRUE
if ioctlsocket() returns 0. This is not the case at the
moment.
This causes problems in WindowProc() of
AsyncSocketEx.cpp when processing the FD_READ
event.
A correct implementation of IOCtl() would be:
BOOL CAsyncSocketEx::IOCtl( long lCommand,
DWORD* lpArgument )
{
return (SOCKET_ERROR != ioctlsocket
(m_SocketData.hSocket, lCommand, lpArgument));
}
Thanks for the fix