<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Sending UDP packets and QUdpSocket::writeDatagram]]></title><description><![CDATA[<p dir="auto">Here is a snippet of code that I am using send a UDP packet.  All works fine as long as the destination IP address is active.  If the IP address is not active/reachable I see ARP 'who has a.b.c.d'. With UDP being connectionless I would not expect this behavior.  Any comments or suggestions are welcome.</p>
<p dir="auto">60    4.562357000    DellEsgP_e1:83:f2    Broadcast    ARP    42    Who has 192.168.1.119?  Tell 192.168.1.123<br />
Thanks,</p>
<hr />
<p dir="auto">txSocket = new QUdpSocket(this);    //create UDP socket to send to</p>
<p dir="auto">txPacket.clear();<br />
txDatagram.clear();</p>
<p dir="auto">// Build a packet to send<br />
txPacket.append("This is a test");<br />
txPacket.append(" ");</p>
<p dir="auto">//Create the datagram<br />
txDatagram = txPacket.toUtf8(); //convert string to datagram</p>
<p dir="auto">//Send the datagram</p>
<p dir="auto">txSocket-&gt;writeDatagram(txDatagram.data(), txDatagram.size(), QHostAddress("192.168.1.118"), 1000);</p>
]]></description><link>https://forum.qt.io/topic/33629/sending-udp-packets-and-qudpsocket-writedatagram</link><generator>RSS for Node</generator><lastBuildDate>Mon, 17 Aug 2026 19:58:32 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/33629.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 28 Oct 2013 16:34:44 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Sending UDP packets and QUdpSocket::writeDatagram on Thu, 31 Oct 2013 16:55:12 GMT]]></title><description><![CDATA[<p dir="auto">Thanks, for the reminder an layer 2 behavior.</p>
<p dir="auto">Jay</p>
]]></description><link>https://forum.qt.io/post/202499</link><guid isPermaLink="true">https://forum.qt.io/post/202499</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Thu, 31 Oct 2013 16:55:12 GMT</pubDate></item><item><title><![CDATA[Reply to Sending UDP packets and QUdpSocket::writeDatagram on Thu, 31 Oct 2013 09:30:14 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">this is the correct behaviour.</p>
<p dir="auto">ARP means (Address Resolution Protocol); when a destination address couldn’t be resolved by ARP, the UDP packet isn’t sent. In this way the network isn’t full of <em>no-destination</em> packets.</p>
<p dir="auto">UPD is a connectionless protocol, so if the destination is resolved the packet is sent regardless if there is someone ready to recevie it..</p>
]]></description><link>https://forum.qt.io/post/202439</link><guid isPermaLink="true">https://forum.qt.io/post/202439</guid><dc:creator><![CDATA[mcosta]]></dc:creator><pubDate>Thu, 31 Oct 2013 09:30:14 GMT</pubDate></item></channel></rss>