void Aggregator :: handleMessage(cMessage *msg)
{
if(msg==timeoutEvent)
{
while(!pending.empty()) {
send(pending.back(),"out");
pending.pop_back();
}
scheduleAt(simTime()+timeout,timeoutEvent);
}
else{
cPacket *pkt = check_and_cast<cPacket *>(msg);//type casting message into packet type
if (pending.empty() || pending.back()->getByteLength()>=1500)
pending.push_back(pkt);
else
pending.back()->encpasulate(pkt);
}
}
Sent from Mail for Windows 10
To unsubscribe from this group and stop receiving emails from it, send an email to omn...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/omnetpp/8692d970-ffe9-4335-ae35-6804099acaf1%40googlegroups.com.
That you don’t set con_message to nullptr, if the first time last is not null you set con_message, but if the next time, last is nullptr, con_message has the information of the previous packet.
The code that I have sent, remove unnecessary variables and reduce this type of problem.
But it is enough to set con_message = nullptr at the beginning of concateMsg
To view this discussion on the web visit https://groups.google.com/d/msgid/omnetpp/12ce2851-19d6-4a7f-b0e6-12aca160af2b%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/omnetpp/fb7ce728-2109-4b1d-a69e-182cf9c4f571%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/omnetpp/fb7ce728-2109-4b1d-a69e-182cf9c4f571%40googlegroups.com.