UdpHostCache now answering incoming UDP pings

While still on the UDP track, I decided to add some code that sends UDP pongs in response to incoming UDP pings. Most of the code was already written. I had to extend UdpSwitch to create a new UdpConnection when a datagram from unknown source is received. The new UdpConnection object gets associated with the source address and all packets from this address get queued by the connection. In the current scenario only one packet will be received but with this design we are ready for the future ;-).

If accepting incoming connection is enabled when the UdpSwitch object is started, then new UdpConnections will be created as described above and a signal with the connection pointer as an argument will be emitted. LocalPeer connects this signal with the new slot of UdpHostCache and we are done! All seems to work fine. Occasionally (I don’t know that is a ‘normal’ rate) I see a line in the log saying that Calitko is answering a UDP ping.

Peter

Would you like to post a relpy?


This post starts a thread.
No follow-ups yet.