Changes between Version 35 and Version 36 of GuiRpc


Ignore:
Timestamp:
Aug 15, 2013, 9:37:19 AM (11 years ago)
Author:
davea
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GuiRpc

    v35 v36  
    11[[PageOutline]]
    22
    3 = Controlling the core client via RPC =
    4 
    5 The BOINC core client provides a set of RPCs (remote procedure calls) for control and state interrogation.
    6 This enables the development of GUI (graphical user interface) programs separately from the core client.
     3= Controlling the BOINC client via RPC =
     4
     5The BOINC core client provides a set of RPCs (remote procedure calls)
     6for control and state interrogation.
     7This enables the development of GUI (graphical user interface) programs.
    78These RPCs send XML request and reply messages over a TCP connection.
    8 The XML formats are not documented, but can be deduced from the source code.
    9 
    10 BOINC provides a C++ interface to these RPCs, consisting of the GUI_RPC class.
    11 The interface is in [source:boinc/lib/gui_rpc_client.h lib/gui_rpc_client.h],
    12 and the program [source:boinc/client/boinc_cmd.cpp boinc_cmd.cpp] gives a usage example.
    13 All member functions return an integer error code.
    14 It should be fairly easy to generate client interfaces in languages other than C++.
     9The XML formats are not documented, but can be inferred from the source code.
     10
     11The following bindings are available:
     12
     13 * BOINC has a C++ binding, consisting of the GUI_RPC class.
     14  The interface is in [source:boinc/lib/gui_rpc_client.h lib/gui_rpc_client.h],
     15  and the program [source:boinc/client/boinc_cmd.cpp boinc_cmd.cpp]
     16  gives a usage example.
     17  All member functions return an integer error code.
     18 * BOINC has a Java binding in [source:boinc/android/BOINC/src/edu/berkeley/boinc/rpc/].
     19 * A .Net binding is available at https://boincguirpc.codeplex.com/
     20
     21It should be easy to generate bindings in other languages.
    1522GUI programs connect to the core client by opening a TCP socket at port 31416.
    1623They can then do repeated RPCs over this connection.
    1724Each reply message ends with the character \003.
    1825
    19 To create an RPC connection, call
    20 
    21  `init(char* host)`::
    22  Establish RPC connection to the given host.
     26The rest of this document describes the C++ interface.
     27The functions listed are members of the '''RPC_CLIENT''' class.
     28
     29== Connecting ==
     30
     31To establish RPC connection to a host,
     32create a `RPC_CLIENT` object and call
     33{{{
     34`init(char* host)`.
     35}}}
    2336
    2437== Dealing with versions ==
    2538
    2639The GUI RPC protocol changes over time.
    27 If you're writing a GUI program that needs to communicate with older versions of the BOINC core client,
    28 here's what to do:
    29 
    30  * Create a `GUI_RPC` object and connect.
    31   Call `exchange_versions()` to get the client version.
     40If you're writing a GUI program that needs to communicate with older
     41versions of the BOINC client:
     42
     43 * Call `exchange_versions()` to get the client version.
    3244 * If `exchange_versions()` fails (it's not supported in pre-5.6 clients)
    3345  do a `get_state()` RPC, and get the client version from `CC_STATE::version_info`.