mirror of https://github.com/BOINC/boinc.git
*** empty log message ***
svn path=/trunk/boinc/; revision=3205
This commit is contained in:
parent
5a91f646c8
commit
0f1e2f5984
|
@ -11235,3 +11235,14 @@ David April 1 2004
|
|||
lib/
|
||||
messages.C
|
||||
util.C,h
|
||||
|
||||
|
||||
Davaid April 1 2004
|
||||
- print message when resume network activity
|
||||
- flesh out GUI RPC for messages
|
||||
|
||||
client/
|
||||
cs_prefs.C
|
||||
gui_rpc_client.C,h
|
||||
gui_test.C
|
||||
makefile.gui_test (new)
|
||||
|
|
|
@ -154,7 +154,7 @@ int CLIENT_STATE::suspend_activities(int reason) {
|
|||
// since activities_suspended is now true
|
||||
//
|
||||
int CLIENT_STATE::resume_activities() {
|
||||
msg_printf(NULL, MSG_INFO, "Resuming activity");
|
||||
msg_printf(NULL, MSG_INFO, "Resuming computation and network activity");
|
||||
active_tasks.unsuspend_all();
|
||||
return 0;
|
||||
}
|
||||
|
@ -182,6 +182,7 @@ int CLIENT_STATE::suspend_network(int reason) {
|
|||
}
|
||||
|
||||
int CLIENT_STATE::resume_network() {
|
||||
msg_printf(NULL, MSG_INFO, "Resuming network activity");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -95,6 +95,67 @@ int RPC_CLIENT::get_state() {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int RPC_CLIENT::result_show_graphics(RESULT& result) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int RPC_CLIENT::project_reset(PROJECT& project) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int RPC_CLIENT::project_attach(char* url, char* auth) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int RPC_CLIENT::project_detach(PROJECT&) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int RPC_CLIENT::project_update(PROJECT&) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int RPC_CLIENT::set_run_mode(int mode) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int RPC_CLIENT::run_benchmarks() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int RPC_CLIENT::set_proxy_settings(PROXY_INFO& pi) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int RPC_CLIENT::get_messages(
|
||||
int nmessages, int offset, vector<MESSAGE_DESC>& msgs
|
||||
) {
|
||||
char buf[256];
|
||||
fprintf(fout,
|
||||
"<get_messages>\n"
|
||||
" <nmessages>%d</nmessages>\n"
|
||||
" <offset>%d</offset>\n"
|
||||
"</get_messages>\n",
|
||||
nmessages, offset
|
||||
);
|
||||
while (fgets(buf, 256, fin)) {
|
||||
if (match_tag(buf, "<msgs>")) continue;
|
||||
if (match_tag(buf, "</msgs>")) break;
|
||||
if (match_tag(buf, "<msg>")) {
|
||||
MESSAGE_DESC md;
|
||||
while (fgets(buf, 256, fin)) {
|
||||
if (match_tag(buf, "</msg>")) break;
|
||||
if (parse_str(buf, "<project>", md.project)) continue;
|
||||
if (parse_str(buf, "<body>", md.body)) continue;
|
||||
if (parse_int(buf, "<pri>", md.priority)) continue;
|
||||
if (parse_int(buf, "<time>", md.timestamp)) continue;
|
||||
}
|
||||
msgs.push_back(md);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void RPC_CLIENT::print() {
|
||||
unsigned int i;
|
||||
|
||||
|
|
|
@ -116,6 +116,25 @@ struct ACTIVE_TASK {
|
|||
void print();
|
||||
};
|
||||
|
||||
struct PROXY_INFO {
|
||||
bool use_http_proxy;
|
||||
bool use_socks_proxy;
|
||||
int socks_version;
|
||||
char socks_server_name[256];
|
||||
char http_server_name[256];
|
||||
int socks_server_port;
|
||||
int http_server_port;
|
||||
char socks5_user_name[256];
|
||||
char socks5_user_passwd[256];
|
||||
};
|
||||
|
||||
struct MESSAGE_DESC {
|
||||
string project;
|
||||
int priority;
|
||||
int timestamp;
|
||||
string body;
|
||||
};
|
||||
|
||||
class RPC_CLIENT {
|
||||
int sock;
|
||||
FILE* fin;
|
||||
|
|
|
@ -8,8 +8,16 @@
|
|||
main(int argc, char** argv) {
|
||||
RPC_CLIENT rpc;
|
||||
unsigned int i;
|
||||
vector<MESSAGE_DESC> message_descs;
|
||||
|
||||
rpc.init("gui_rpc");
|
||||
rpc.get_state();
|
||||
rpc.print();
|
||||
rpc.get_messages(20, 0, message_descs);
|
||||
for (i=0; i<message_descs.size(); i++) {
|
||||
MESSAGE_DESC& md = message_descs[i];
|
||||
printf("%s %d %d %s\n",
|
||||
md.project.c_str(), md.priority, md.timestamp, md.body.c_str()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
gui_test: gui_test.C gui_rpc_client.C gui_rpc_client.h
|
||||
g++ -g -I../lib -o gui_test -lnsl -lsocket gui_test.C gui_rpc_client.C ../lib/libboinc.a
|
Loading…
Reference in New Issue