UDP application.
More...
#include <UDPEchoApp.h>
|
static simsignal_t | pkSignal = registerSignal("pk") |
|
UDP application.
See NED for more info.
void inet::UDPEchoApp::finish |
( |
| ) |
|
|
overrideprotectedvirtual |
75 ApplicationBase::finish();
void inet::UDPEchoApp::handleMessageWhenUp |
( |
cMessage * |
msg | ) |
|
|
overrideprotectedvirtual |
Implements inet::OperationalBase.
47 cPacket *pk =
PK(msg);
53 UDPDataIndication *ctrl = check_and_cast<UDPDataIndication *>(pk->removeControlInfo());
54 L3Address srcAddress = ctrl->getSrcAddr();
55 int srcPort = ctrl->getSrcPort();
62 throw cRuntimeError(
"Message received with unexpected message kind = %d", msg->getKind());
UDPSocket socket
Definition: UDPEchoApp.h:34
Definition: UDPControlInfo_m.h:83
void sendTo(cPacket *msg, L3Address destAddr, int destPort, const SendOptions *options=nullptr)
Sends a data packet to the given address and port.
Definition: UDPSocket.cc:88
int numEchoed
Definition: UDPEchoApp.h:35
Definition: UDPControlInfo_m.h:84
#define PK(msg)
Definition: INETDefs.h:92
static simsignal_t pkSignal
Definition: UDPEchoApp.h:36
void inet::UDPEchoApp::handleNodeCrash |
( |
| ) |
|
|
overrideprotectedvirtual |
bool inet::UDPEchoApp::handleNodeShutdown |
( |
IDoneCallback * |
doneCallback | ) |
|
|
overrideprotectedvirtual |
bool inet::UDPEchoApp::handleNodeStart |
( |
IDoneCallback * |
doneCallback | ) |
|
|
overrideprotectedvirtual |
Reimplemented from inet::OperationalBase.
81 int localPort = par(
"localPort");
83 MulticastGroupList mgl = getModuleFromPar<IInterfaceTable>(par(
"interfaceTableModule"),
this)->collectMulticastGroups();
UDPSocket socket
Definition: UDPEchoApp.h:34
void joinLocalMulticastGroups(MulticastGroupList mgl)
Joins the socket to each multicast group that are registered with any of the interfaces.
Definition: UDPSocket.cc:194
void setOutputGate(cGate *toUdp)
Sets the gate on which to send to UDP.
Definition: UDPSocket.h:110
void bind(int localPort)
Bind the socket to a local port number.
Definition: UDPSocket.cc:53
std::vector< MulticastGroup > MulticastGroupList
Definition: IInterfaceTable.h:36
void inet::UDPEchoApp::initialize |
( |
int |
stage | ) |
|
|
overrideprotectedvirtual |
Reimplemented from inet::OperationalBase.
int numEchoed
Definition: UDPEchoApp.h:35
Local initializations.
Definition: InitStages.h:35
virtual void initialize(int stage) override
Definition: OperationalBase.cc:32
virtual int inet::UDPEchoApp::numInitStages |
( |
| ) |
const |
|
inlineoverrideprotectedvirtual |
Reimplemented from inet::OperationalBase.
The number of initialization stages.
Definition: InitStages.h:116
void inet::UDPEchoApp::refreshDisplay |
( |
| ) |
const |
|
overrideprotectedvirtual |
69 sprintf(buf,
"echoed: %d pks",
numEchoed);
70 getDisplayString().setTagArg(
"t", 0, buf);
int numEchoed
Definition: UDPEchoApp.h:35
int inet::UDPEchoApp::numEchoed |
|
protected |
simsignal_t inet::UDPEchoApp::pkSignal = registerSignal("pk") |
|
staticprotected |
The documentation for this class was generated from the following files: