How to send a specific message for udpapp in inet framework?

714 views
Skip to first unread message

omnetuser99

unread,
Jan 10, 2013, 5:55:48 AM1/10/13
to omn...@googlegroups.com
Hi,

I want to send a specific message e.g. "Test Message" from host1 to host2. Right now I can send a dummy message through following lines in .INI file and it works but how can I specify a specific message in a packet rather than a dummy message?

**.host[0].numUdpApps = 1
**.host[0].udpApp[0].typename = "UDPBasicApp"
**.host[0].udpApp[0].localPort = 100
**.host[0].udpApp[0].destPort = 100
**.host[0].udpApp[0].messageLength = 128 bytes
**.host[0].udpApp[0].sendInterval = 1s
**.host[0].udpApp[0].destAddresses = "host[1]"

**.host[1].numUdpApps = 1
**.host[1].udpApp[0].typename = "UDPSink"
**.host[1].udpApp[0].localPort = 100

Also, if i specify a message, do I need to specify messageLength as well?

Thank you.

omnetuser99

unread,
Jan 11, 2013, 7:08:48 AM1/11/13
to omn...@googlegroups.com
I checked the paramters of UDP Basic App but none of them was about specifying a particular message. Is it possible to specify it this way or even some other alternative way to send a custom message?

Vitor Bernardo

unread,
Jan 11, 2013, 7:23:22 AM1/11/13
to omn...@googlegroups.com
Take a look on UDPBasicApp class and check the createPacket method. For instance, can extend the UDPBasicApp and include the "custom message"...

--
BR,
Vítor Bernardo


--
--
Sent from the OMNeT++ mailing list. To configure your membership,
visit http://groups.google.com/group/omnetpp
 
 
 

Adee

unread,
Jan 23, 2013, 3:48:21 AM1/23/13
to omn...@googlegroups.com
You can use addpar() to add object with the message or create your own Packet class through inheritance. BTW I guess addpar() will work for you.
You can easily find the example of addpar() in omnet manual.

-Adee

Reply all
Reply to author
Forward
0 new messages