windows async select

svn path=/trunk/boinc/; revision=949
This commit is contained in:
Eric Heien 2003-02-20 00:12:30 +00:00
parent cea4b691d9
commit b45b23df1b
3 changed files with 13 additions and 3 deletions

View File

@ -74,7 +74,7 @@ CLIENT_STATE::CLIENT_STATE() {
platform_name = HOST;
exit_after_app_start_secs = 0;
app_started = 0;
max_transfer_rate = 9999;
max_transfer_rate = 999999999;
max_bytes = 0;
user_idle = true;
use_http_proxy = false;

View File

@ -22,8 +22,10 @@
#include <stdio.h>
#ifdef _WIN32
#include "winsock.h"
#include <afxwin.h>
#include <winsock.h>
#include "Win_net.h"
#include "wingui_mainwindow.h"
#endif
#if HAVE_SYS_TIME_H
@ -125,6 +127,14 @@ int NET_XFER::open_server() {
NetClose();
return -1;
}
if (WSAAsyncSelect( fd, g_myWnd->GetSafeHwnd(), WM_TIMER, FD_READ|FD_WRITE )) {
errno = WSAGetLastError();
if (errno != WSAEINPROGRESS && errno != WSAEWOULDBLOCK) {
closesocket(fd);
NetClose();
return -1;
}
}
#else
if (errno != EINPROGRESS) {
close(fd);

View File

@ -42,7 +42,7 @@
#define EDGE_BUFFER 2 // buffer pixels around edge of client
#define ID_TIMER 104 // timer id
#define TIMEOUT_WAIT 100 // timeout sleep time (in milliseconds)
#define TIMEOUT_WAIT 1000 // timeout sleep time (in milliseconds)
#define STATUS_ICON_ID (WM_USER + 1) // id for notifications from status icon