P1---udpBasicApp
From P1, I use udpBasicAPP to broadcast message and receive it, it can work successfully. From the results of simulation, i can see that the udpBasicAPP has sent and received messages.Try this code
It is a flooding implementation, it uses broadcast packets
If you want to stop the propagation to only one hop you can if you modify the method processPacket
void UDPBasicFlooding::processPacket(cPacket *pk) |
{ |
if (pk->getKind() == UDP_I_ERROR) |
{ |
EV << "UDP error received\n"; |
delete pk; |
return; |
} |
||||||||
return; |
||||||||
} |
--
You received this message because you are subscribed to the Google Groups "OMNeT++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
omnetpp+u...@googlegroups.com.
Visit this group at https://groups.google.com/group/omnetpp.
For more options, visit https://groups.google.com/d/optout.
Send me the files, I will try to check the problem when I have some free time
Send me the files, I will try to check the problem when I have some free time
You have several miss concepts about the class inherit. You have include in the derived class ‘UDPSocket socket’ variable,
This is the problem. This variable is defined in the base class, any class derived from the base class can use this variable, but in the moment that you redefine this variable in your class, you cannot access to this variable, the base class register the port and if you class try to send a packet without register it cannot, but if you try to register you have registered two times the port.
There are other errors, for example
basicCamContainer * lastmcam = carCamGeneration(host, mobility);
You reserve memory in the method but you lost the reference to this memory, with this, in a long simulation you will end without memory and the simulation will crash, if don’t need the memory that you have reserved, you should delete it
delete(carCamGeneration(host, mobility));
or
basicCamContainer * lastmcam = carCamGeneration(host, mobility);
delete lastmcam;
To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/omnetpp.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "OMNeT++ Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/omnetpp/0DP-EOunJ4s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to omnetpp+unsubscribe@googlegroups.com.