Changes between Version 47 and Version 48 of GuiRpc
- Timestamp:
- Jan 29, 2021, 12:17:42 AM (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
GuiRpc
v47 v48 11 11 The following bindings are available: 12 12 13 * BOINC has a C++ binding, consisting of the GUI_RPCclass.13 * BOINC has a C++ binding, consisting of the RPC_CLIENT class. 14 14 The interface is in 15 15 [https://github.com/BOINC/boinc/blob/master/lib/gui_rpc_client.h lib/gui_rpc_client.h], … … 35 35 == Connecting == 36 36 37 To establish RPC connection to a host, 38 create a `RPC_CLIENT` object and call 39 {{{ 40 `init(char* host)`. 37 To establish an RPC connection to a host: 38 39 {{{ 40 RPC_CLIENT rpc; 41 rpc.init(char* host) 41 42 }}} 42 43 … … 46 47 If you're writing a GUI program that needs to communicate with older 47 48 versions of the BOINC client: 48 49 * Call `exchange_versions()` to get the client version. 50 * If `exchange_versions()` fails (it's not supported in pre-5.6 clients) 51 do a `get_state()` RPC, and get the client version from `CC_STATE::version_info`. 52 * Use the client version number to decide what subsequent RPCs to make 53 (version info is included in the RPC list below). 54 55 {{{ 56 #!comment 57 Most RPCs on the list *lack* version information saying since when they're available. 58 }}} 49 {{{ 50 exchange_versions("your program name", VERSION_INFO& v)); 51 }}} 52 The client's version is returned in v. 53 Use the client version number to decide what subsequent RPCs to make 54 (some version info is included in the RPC list below). 59 55 60 56 == Authorization == 61 57 62 The RPC protocol allows the GUI program to authenticate itself using a password. 58 The RPC protocol allows the GUI program to authenticate itself using a 59 [https://boinc.berkeley.edu/wiki/Controlling_BOINC_remotely password]. 63 60 Some of the RPC operations can be done without authentication; 64 61 others can be done without authentication, 65 62 but only by a GUI program running on the same machine. 66 63 67 `authorize(char* password)`:: 68 Do authorization sequence with the peer, using given password. 64 {{{ 65 retval = rpc.authorize(char* password) 66 }}} 67 Authorize with the peer, using given password. 69 68 70 69 == RPC list == 70 71 71 The following functions require authorization for remote clients, but not for local clients. 72 Note: for client versions 5.5.12 and earlier,73 all functions except `get_state()`,74 `get_results()`, `get_screensaver_mode()`,75 and `set_screensaver_mode()` require authorization.76 72 77 73 {{{ … … 80 76 parts broken that way to allow word wrap. 81 77 }}} 82 83 `exchange_versions(VERSION_INFO&)`::84 Exchange version info with the client.85 The client's version info is returned.86 87 `get_activity_state(ACTIVITY_STATE&)`::88 Return bitmap of reasons why computation and network are suspended.89 '''Deprecated''' - for 5.5.13 and later, use cc_status() instead.90 In 5.5.10 and earlier, it returns a `bool` (suspended) rather than bitmap.91 78 92 79 `get_cc_status(CC_STATUS&)`:: … … 186 173 Get information about project credit history (the `PROJECT::statistics` field is populated). 187 174 188 `network_status(int&)`::189 Find whether the client has, needs, or is done with a physical network connection.190 Deprecated - for 5.5.13 and later, use [#function-cc_status cc_status()] instead.191 192 175 `set_screensaver_mode``(bool enabled, ``double blank_time, ``DISPLAY_INFO&)`:: 193 176 If `enabled` is `true`, the client should try to get an application to provide screensaver graphics. … … 251 234 Run benchmarks. 252 235 253 `set_debts(vector<PROJECT>)`::254 Set the short- and long-term debts of the given projects255 (only the `master_url`, `short_term_debt`, `long_term_debt`, `cuda_debt` and `ati_debt`256 fields are used in the `PROJECT` structs).257 258 236 `set_global_prefs_override(string&)`:: 259 237 Write the given contents to the global preferences override file.