teach nmmsender to also transmit already serialized messages
parent
aed36e1bf8
commit
9955463c93
14
nmmsender.cc
14
nmmsender.cc
|
@ -175,16 +175,22 @@ void NMMSender::sendTCPThread(Destination* d)
|
|||
|
||||
|
||||
void NMMSender::emitNMM(const NavMonMessage& nmm)
|
||||
{
|
||||
string out;
|
||||
nmm.SerializeToString(& out);
|
||||
emitNMM(out);
|
||||
}
|
||||
|
||||
void NMMSender::emitNMM(const std::string& out)
|
||||
{
|
||||
for(auto& d : d_dests) {
|
||||
d->emitNMM(nmm, d_compress);
|
||||
d->emitNMM(out, d_compress);
|
||||
}
|
||||
}
|
||||
|
||||
void NMMSender::Destination::emitNMM(const NavMonMessage& nmm, bool compressed)
|
||||
|
||||
void NMMSender::Destination::emitNMM(const std::string& out, bool compressed)
|
||||
{
|
||||
string out;
|
||||
nmm.SerializeToString(& out);
|
||||
string msg;
|
||||
if(dst.empty() || !compressed)
|
||||
msg="bert";
|
||||
|
|
|
@ -16,7 +16,7 @@ class NMMSender
|
|||
|
||||
std::deque<std::string> queue;
|
||||
std::mutex mut;
|
||||
void emitNMM(const NavMonMessage& nmm, bool compress);
|
||||
void emitNMM(const std::string& out, bool compress);
|
||||
};
|
||||
|
||||
public:
|
||||
|
@ -45,6 +45,7 @@ public:
|
|||
void sendTCPThread(Destination* d);
|
||||
|
||||
void emitNMM(const NavMonMessage& nmm);
|
||||
void emitNMM(const std::string& out);
|
||||
bool d_debug{false};
|
||||
bool d_compress{false}; // set BEFORE launch
|
||||
bool d_pleaseQuit{false};
|
||||
|
|
Loading…
Reference in New Issue