- // Check for valid socket
- if ((!m_connected && !m_establishing) || !m_socket)
- return FALSE;
-
- // Check for valid timeout value
- if (seconds != -1)
- timeout = seconds * 1000 + milliseconds;
- else
- timeout = m_timeout * 1000;
-
- // Activate timer
- timer.m_state = &state;
- timer.m_new_val = 0;
- timer.Start(timeout, TRUE);
-
- // Active polling (without using events)
- result = GSocket_Select(m_socket, flags);
-
- while ((result == 0) && (state == -1))
- {
- wxYield();
- result = GSocket_Select(m_socket, flags);
- }
-
- timer.Stop();
-
- return (result != 0);
-}
-
-bool wxSocketBase::Wait(long seconds, long milliseconds)
-{
- return _Wait(seconds, milliseconds, GSOCK_INPUT_FLAG |
- GSOCK_OUTPUT_FLAG |
- GSOCK_CONNECTION_FLAG |
- GSOCK_LOST_FLAG);
-}
-
-bool wxSocketBase::WaitForRead(long seconds, long milliseconds)
-{
- return _Wait(seconds, milliseconds, GSOCK_INPUT_FLAG | GSOCK_LOST_FLAG);
-}
-
-bool wxSocketBase::WaitForWrite(long seconds, long milliseconds)
-{
- return _Wait(seconds, milliseconds, GSOCK_OUTPUT_FLAG | GSOCK_LOST_FLAG);
-}
-
-bool wxSocketBase::WaitForLost(long seconds, long milliseconds)
-{
- return _Wait(seconds, milliseconds, GSOCK_LOST_FLAG);