close
Warning:
BrowserModule failed with ConfigurationError: Look in the Trac log for more information.
- Timestamp:
-
Jul 7, 2009, 2:00:51 PM (15 years ago)
- Author:
-
heep
- Comment:
-
--
Legend:
- Unmodified
- Added
- Removed
- Modified
-
v27
|
v28
|
|
80 | 80 | }}} |
81 | 81 | |
82 | | Numeric parameters, like sendPeriod, can use custom units (in this case, seconds). |
| 82 | Numeric 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. |
83 | 83 | |
84 | 84 | |
… |
… |
|
171 | 171 | // Enumerations in messages MUST have a value. |
172 | 172 | |
173 | | enum MessageType { |
| 173 | enum MessageType |
| 174 | { |
174 | 175 | MYMSG_PING = 1; // outgoing message |
175 | 176 | MYMSG_PONG = 2; // returning message |
… |
… |
|
178 | 179 | // now we declare the message proper |
179 | 180 | |
180 | | packet MyMessage { |
| 181 | packet MyMessage |
| 182 | { |
181 | 183 | int type enum (MessageType); // message type |
182 | 184 | TransportAddress senderAddress; // address of the node that sent the message |
… |
… |
|
388 | 390 | {{{ |
389 | 391 | #!cpp |
390 | | class MyOverlay : public BaseOverlay { |
| 392 | class MyOverlay : public BaseOverlay |
| 393 | { |
391 | 394 | public: |
392 | 395 | // Routing parameters |
… |
… |
|
405 | 408 | void setOwnNodeID(); // (optional) called to set the key of this node (random otherwise) |
406 | 409 | 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 |
408 | 411 | |
409 | 412 | // obligatory: called when we need the next hop to route a packet to the given key |
… |
… |
|
710 | 713 | {{{ |
711 | 714 | #!cpp |
712 | | class MyOverlay : public BaseOverlay { |
| 715 | class MyOverlay : public BaseOverlay |
| 716 | { |
713 | 717 | ... |
714 | 718 | // The function that will be called from outside |
… |
… |
|
799 | 803 | // Only delete msg if the RPC is handled here, and you won't respond using sendRpcResponse! |
800 | 804 | |
801 | | bool MyOverlay::handleRpcCall(BaseCallMessage *msg) { |
| 805 | bool MyOverlay::handleRpcCall(BaseCallMessage *msg) |
| 806 | { |
802 | 807 | |
803 | 808 | // There are many macros to simplify the handling of RPCs. The full list is in <OverSim>/src/common/RpcMacros.h. |