Esempio n. 1
0
void ProxyV2V::nextPacket(const odcore::data::Packet &p) {
    if(m_debug) {
        cout << "[" << getName() << "] Received a packet from " << p.getSender() << ", "
             << "with " << p.getData().length()
             // << " bytes containing '"
             // << p.getData() << "'"
             << endl;
    }

    opendlv::proxy::V2vReading nextMessage;
    nextMessage.setSize(p.getData().length());
    nextMessage.setData(p.getData());

    odcore::data::Container c(nextMessage);
    getConference().send(c);
}
Esempio n. 2
0
            void UDPReceiver::nextPacket(const odcore::data::Packet &p) {
                Lock l(m_listenerMutex);

                // Pass packet either to string listner, the synchronous packet
                // listener, or to packet pipeline.
                if (m_stringListener != NULL) {
                    m_stringListener->nextString(p.getData());
                }
                else if (m_synchronousPacketListener != NULL) {
                    m_synchronousPacketListener->nextPacket(p);
                }
                else {
                    m_packetPipeline.nextPacket(p);
                }
            }