Overview
Massive Multiuser Event InfraStructure(M2etis) is a framework for optimizing event dissemination via a Peer-to-Peer(p2p) network
Architecture of M2etis
UML diagram of M2etis
Usage by application
The class m2etis::pubsub::PubSubSystem is the main entry point of the PubSub-Component of M2etis.
Code-Example
10 std::cout <<
this <<
" received a message!" << std::endl;
19 p1.
subscribe<CharVectorEventType>(m2etis::pubsub::ChannelName::TEST_Direct_Null_Null_Null_Null_Null_Null_Null_CharVector_TCP, d1);
20 p2.subscribe<CharVectorEventType>(m2etis::pubsub::ChannelName::TEST_Direct_Null_Null_Null_Null_Null_Null_Null_CharVector_TCP, d2);
23 p1.publish<CharVectorEventType>(m2etis::pubsub::ChannelName::TEST_Direct_Null_Null_Null_Null_Null_Null_Null_CharVector_TCP, m1);
26 p2.publish<CharVectorEventType>(m2etis::pubsub::ChannelName::TEST_Direct_Null_Null_Null_Null_Null_Null_Null_CharVector_TCP, m2);
boost::shared_ptr< M2Message< EventType > > Ptr
BasicChannelInterface< EventType > & subscribe(const ChannelName channel, BasicDeliverCallbackInterface< EventType > &callback)
User subscribes to the requested channel.
M2ETIS_API typedef BasicDeliverCallbackInterface< std::vector< unsigned char > > DeliverCallbackInterface
class for accessing the m2etis pub/sub system. It is the main entry point for the usage of the m2etis...
- line 7-12: declares class being able to receive messages deriving from m2etis::pubsub::DeliverCallbackInterface
- line 9-11: is the actual deliverCallback where messages arrive
- line 16: inits a node with own port 12345 and root port 12345 (so this node will be the root node)
- line 17: inits a node with own port 12346 and root port 12345 (so this node will not be root node)
- line 19-20: both nodes subscribe on one of the predefined topics
- line 22/25: creates a publish message for each of the nodes
- line 23/26: publishes the message on the chosen topic
Key based routing(KBR) API
m2etis::net::NetworkInterface represents the KBR-API. It is an abstraction of the basic functionality of P2P-Networks using KBR.
NetworkController
m2etis::net::NetworkController implements the m2etis::net::NetworkCallbackInterface and represents the connection between the PubSub-Component and the P2P-Network. It has the needed functionality for m2etis::pubsub::Channel for sending messages to the network
Links