30 #include "../../MetaData.h"
34 using namespace boost;
36 using namespace rsc::logging;
37 using namespace rsc::runtime;
43 transport::InPushConnector* InPushConnector::create(
const Properties& args) {
44 LoggerPtr logger = Logger::getLogger(
"rsb.transport.socket.InPushConnector");
45 RSCDEBUG(logger,
"Creating InPushConnector with properties " << args);
47 return new InPushConnector(args.get<ConverterSelectionStrategyPtr>(
"converters"),
51 args.getAs<
bool> (
"tcpnodelay",
true));
60 InConnector(converters, host, port, server, tcpnodelay),
61 logger(Logger::getLogger(
"rsb.transport.socket.InPushConnector")) {
73 throw std::runtime_error(
"Cannot handle events when not active");
80 event->mutableMetaData().setReceiveTime();
84 boost::shared_ptr<string> wireData = static_pointer_cast<
string>(
event->getData());
85 string wireSchema =
event->getMetaData().getUserInfo(
"rsb.wire-schema");
89 =
getConverter(wireSchema)->deserialize(wireSchema, *wireData);
90 event->setData(d.second);
91 event->setType(d.first);
95 for (HandlerList::iterator it = this->
handlers.begin(); it
std::pair< std::string, boost::shared_ptr< void > > AnnotatedData
A combination of data type and the actual data.
void handle(EventPtr event)
Handle event.
virtual ~InPushConnector()
Basic message that is exchanged between informers and listeners.
virtual void setScope(const Scope &scope)
Instances of this class receive events from a bus that is accessed via a socket connection.
This class is intended to be used as a base class for connector classes of the socket-based transport...
virtual void setScope(const Scope &scope)
const uint16_t DEFAULT_PORT
ConverterPtr getConverter(const std::string &key) const
Try to find a suitable converter for key .
converter::ConverterSelectionStrategy< std::string >::Ptr ConverterSelectionStrategyPtr
boost::shared_ptr< Event > EventPtr
Scope is a descriptor for a hierarchical channel of the unified bus.
const string DEFAULT_HOST