close Warning: BrowserModule failed with ConfigurationError: Look in the Trac log for more information.

Changes between Version 27 and Version 28 of OverSimDevelop


Ignore:
Timestamp:
Jul 7, 2009, 2:00:51 PM (15 years ago)
Author:
heep
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • OverSimDevelop

    v27 v28  
    8080}}}
    8181
    82 Numeric parameters, like sendPeriod, can use custom units (in this case, seconds).
     82Numeric parameters, like sendPeriod, can be set to be measured in units (in this case, seconds). When you set the value for sendPeriod later in the configuration file, you must use the same unit type: s for seconds, or h for hour, or ms for millisecond, etc. When retrieving the parameter from C++ code, the value will be a normal scalar.
    8383
    8484
     
    171171// Enumerations in messages MUST have a value.
    172172
    173 enum MessageType {
     173enum MessageType
     174{
    174175    MYMSG_PING = 1;           // outgoing message
    175176    MYMSG_PONG = 2;           // returning message
     
    178179// now we declare the message proper
    179180
    180 packet MyMessage {
     181packet MyMessage
     182{
    181183    int type enum (MessageType);     // message type
    182184    TransportAddress senderAddress;  // address of the node that sent the message
     
    388390{{{
    389391#!cpp
    390 class MyOverlay : public BaseOverlay {
     392class MyOverlay : public BaseOverlay
     393{
    391394  public:
    392395    // Routing parameters
     
    405408    void setOwnNodeID();                            // (optional) called to set the key of this node (random otherwise)
    406409    void joinOverlay();                             // called when the node is ready to join the overlay
    407     void finishOverlay();                         // called when the module is about to be destroyed
     410    void finishOverlay();                           // called when the module is about to be destroyed
    408411
    409412    // obligatory: called when we need the next hop to route a packet to the given key
     
    710713{{{
    711714#!cpp
    712 class MyOverlay : public BaseOverlay {
     715class MyOverlay : public BaseOverlay
     716{
    713717    ...
    714718    // The function that will be called from outside
     
    799803// Only delete msg if the RPC is handled here, and you won't respond using sendRpcResponse!
    800804
    801 bool MyOverlay::handleRpcCall(BaseCallMessage *msg) {
     805bool MyOverlay::handleRpcCall(BaseCallMessage *msg)
     806{
    802807   
    803808    // There are many macros to simplify the handling of RPCs. The full list is in <OverSim>/src/common/RpcMacros.h.