for usage
- Template Parameters
-
CcClient | the concrete Client type |
typename | ... Messages message types that the Client interested if the type of JustBytes is declared, a special callback void handleJustBytesCb(uint16_t tag, uint8_t* bytes) is expected see ConsoleClient.hpp |
#include "hmbdc/app/Context.hpp"
#include "hmbdc/app/Client.hpp"
struct Hello
};
struct World
void messageDispatchingStartedCb(uint16_t) override {
cout << "anyone saying hello? - waiting..." << endl;
}
void invokedCb(uint16_t threadSerialNumber) override {
cout << "no one said hello - this world is going to work for a second..." << endl;
sleep(1);
}
void handleMessageCb(Hello const&) {
cout << "someone just said hello - exiting" << endl;
throw(0);
}
};
int main() {
World kingslanding;
MyContext ctx;
ctx.start(kingslanding, 0x01);
sleep(3);
ctx.send(Hello());
ctx.join();
}