diff --git a/checkin_notes b/checkin_notes index 32f2cb7b71..3be5f87064 100755 --- a/checkin_notes +++ b/checkin_notes @@ -12751,4 +12751,21 @@ Rom 5 Oct 2005 Events.h MainFrame.cpp, .h ViewProjects.cpp, .h - \ No newline at end of file + +David 5 Oct 2005 + - In the confirm-before-connect modem case, + do as much communication as possible. + E.g. report all ready-to-report results. + + Implementation: + Add new variable CLIENT_STATE::have_sporadic_connection. + Set to true on network_available RPC. + Set to false when want_network returns false. + Change CLIENT_STATE::want_network() so it waits 10 seconds + after core client stops using network before returning false. + If have_sporadic_connection is true, report results immediately. + + client/ + client_state.C,h + cs_scheduler.C + net_xfer.C diff --git a/client/client_state.C b/client/client_state.C index 1c229f17d6..c7388f8190 100644 --- a/client/client_state.C +++ b/client/client_state.C @@ -119,6 +119,7 @@ CLIENT_STATE::CLIENT_STATE() { total_wall_cpu_time_this_period = 0; must_schedule_cpus = true; want_network_flag = false; + have_sporadic_connection = false; no_gui_rpc = false; have_tentative_project = false; } @@ -1370,17 +1371,37 @@ int CLIENT_STATE::detach_project(PROJECT* project) { return 0; } +// Return true if the core client wants a network connection. +// Don't return false if we've actually been using the network +// in the last 10 seconds (so that polling mechanisms +// have a change to trigger) +// bool CLIENT_STATE::want_network() { - if (http_ops->nops()) return true; - if (network_suspended) return false; - if (want_network_flag) return true; - if (active_tasks.want_network()) return true; - return false; + static double last_true_return=0; + double now = dtime(); + + if (http_ops->nops()) goto return_true; + if (network_suspended) goto return_false; + if (want_network_flag) goto return_true; + if (active_tasks.want_network()) goto return_true; +return_false: + if ((now - last_true_return) > 10) { + have_sporadic_connection = false; + return false; + } + return true; +return_true: + last_true_return = now; + return true; } +// There's now a network connection, after some period of disconnection. +// Do all communication that we can. +// void CLIENT_STATE::network_available() { unsigned int i; + have_sporadic_connection = true; for (i=0; ipers_file_xfers.size(); i++) { PERS_FILE_XFER* pfx = pers_file_xfers->pers_file_xfers[i]; pfx->next_request_time = 0; @@ -1389,6 +1410,9 @@ void CLIENT_STATE::network_available() { PROJECT* p = projects[i]; p->min_rpc_time = 0; } + + // tell active tasks that network is available (for Folding@home) + // active_tasks.network_available(); } diff --git a/client/client_state.h b/client/client_state.h index ac4590aa4b..97db2c235e 100644 --- a/client/client_state.h +++ b/client/client_state.h @@ -204,6 +204,7 @@ public: int report_result_error(RESULT&, const char *format, ...); int reset_project(PROJECT*); bool want_network_flag; + bool have_sporadic_connection; bool want_network(); void network_available(); bool no_gui_rpc; diff --git a/client/cs_scheduler.C b/client/cs_scheduler.C index 7adc8c5808..692da9be8c 100644 --- a/client/cs_scheduler.C +++ b/client/cs_scheduler.C @@ -428,7 +428,8 @@ int CLIENT_STATE::make_scheduler_request(PROJECT* p) { // - the result is ready_to_report (compute done; files uploaded) // - we're either within a day of the report deadline, // or at least work_buf_min_days time has elapsed since -// result was completed. +// result was completed, +// or we have a sporadic connection // PROJECT* CLIENT_STATE::find_project_with_overdue_results() { unsigned int i; @@ -444,6 +445,9 @@ PROJECT* CLIENT_STATE::find_project_with_overdue_results() { if (p->suspended_via_gui) continue; if (!r->ready_to_report) continue; + if (have_sporadic_connection) { + return p; + } if (gstate.now > r->report_deadline - REPORT_DEADLINE_CUSHION) { return p; } diff --git a/client/net_xfer.C b/client/net_xfer.C index 1fb7c8fcfe..81d9437d6d 100644 --- a/client/net_xfer.C +++ b/client/net_xfer.C @@ -96,6 +96,10 @@ int NET_XFER::open_server() { retval = resolve_hostname(hostname, ipaddr, msg); if (retval) { + // If we can't resolve the hostname it generally means that + // there's no physical network connection. + // Make a note of this. + // gstate.want_network_flag = true; msg_printf(0, MSG_ERROR, "%s\n", msg); return retval; diff --git a/doc/anonymous_platform.php b/doc/anonymous_platform.php index 5bd8524627..9b9ae7df40 100644 --- a/doc/anonymous_platform.php +++ b/doc/anonymous_platform.php @@ -7,7 +7,7 @@ echo " BOINC applications, and the BOINC core client, are native-mode programs, so different versions are required for each platform (a 'platform' is the combination of an operating system and a processor type: e.g., -Linux/IntelX86). +Linux and Intel/x86).

BOINC-based projects compile program versions for common platforms diff --git a/doc/boinc_dev.php b/doc/boinc_dev.php index f1373ebd8d..311c6d1673 100644 --- a/doc/boinc_dev.php +++ b/doc/boinc_dev.php @@ -6,8 +6,8 @@ echo "