#include <ctype.h>
#include <winsock.h>
+/* if we use configure for MSW SOCKLEN_T will be already defined */
+#ifndef SOCKLEN_T
#define SOCKLEN_T int
+#endif
+
#define CLASSNAME "_GSocket_Internal_Window_Class"
#define WINDOWNAME "_GSocket_Internal_Window_Name"
*/
GSocketEventFlags GSocket_Select(GSocket *socket, GSocketEventFlags flags)
{
- GSocketEventFlags result = 0;
-
assert(socket != NULL);
- result = flags & socket->m_detected;
-
- /* Explicitly check for input events */
- if ((flags & GSOCK_INPUT_FLAG) && (socket->m_fd != INVALID_SOCKET))
- {
- u_long arg = 0;
- int ret = ioctlsocket(socket->m_fd, FIONREAD, (u_long FAR *) &arg);
-
- if ((ret == 0) && (arg > 0))
- result |= GSOCK_INPUT_FLAG;
- }
-
- return result;
+ return flags & socket->m_detected;
}
/* Attributes */