Problem with modified udp-echo-server application model
I am building a new application model by modifying udp-echo-server
model. What I want to do is whenever the server receives a packet from a
udp echo client, it will send after a specified amount of time a packet
of specified length to a specified destination address.
My approach to this is to pass a class variable destination address from
the helper function when installing the application to the node, as done
in the udp-echo-client model.
Then when starting the application, apart from the server socket as in
the udp-echo-server that listens for incoming packets, I create and bind
a new socket as the client does, in order to send the response packet to
the specified destination address. Whenever I receive a packet in the
new modified udp-echo-servrer, the callback function tries to send the
packet to he destination address with socket.Send method
My problem is that during the callback, the destination address I have
passed is identified as an error and a runtime exception occurs. I pass
it in the same way as I pass it to the udp-echo-client and the echo
client sends properly the messages. I would like to have some feedback
if my approach is wrong, or any advice on how to proceed with debugging
Also I am trying to find a way on how can introduce the delay I want to
the server response. I would like to know if there is somehow a way to
schedule the socket send event for a later time to the simulator.