<?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[UDP communication]]></title><description><![CDATA[<p dir="auto">How to send and receive the data through UDP communication in same .cpp file? I'm using local host for both sender and receiver. I have my code below where all the initialization of variables and declarations made in header file. So, no need to bother about that</p>
<pre><code>#include "sender.h"
#include &lt;QtNetwork/QUdpSocket&gt;
#include &lt;QMessageBox&gt;
#include &lt;exception&gt;
#include &lt;QTimer&gt;
#include &lt;QObject&gt;


Sender::Sender()
    {
        send_socket = new QUdpSocket(this);
        socket = new QUdpSocket(this);

        connect(send_socket, &amp;QUdpSocket::readyRead, this, &amp;Sender::processResponse);

        if (send_socket-&gt;bind(QHostAddress::LocalHost, 4500)) {
            qDebug() &lt;&lt; "Listening for incoming data on port :"&lt;&lt;4500;
        } else {
            qDebug() &lt;&lt; "Error binding UDP socket!";
        }

        QTimer* timer = new QTimer(this);
        connect(timer, &amp;QTimer::timeout, this, &amp;Sender::sendDatagram);
        timer-&gt;start(1000); // Adjust the interval as needed (milliseconds)
    }

    void Sender::sendDatagram()
    {
            send_socket-&gt;writeDatagram(UDP_DATA, receiverAddress, receiverPort);
            qDebug() &lt;&lt; "Sent datagram to" &lt;&lt; receiverAddress.toString() &lt;&lt; ":" &lt;&lt; receiverPort &lt;&lt; "-" &lt;&lt;UDP_DATA;
            //processResponse();
    }

    void Sender::processResponse()
    {
                send_socket-&gt;bind(QHostAddress("192.168.0.110"),4500);
                datagram.resize(send_socket-&gt;pendingDatagramSize());
                QHostAddress senderAddress;
                quint16 senderPort;
                socket-&gt;readDatagram(datagram.data(), datagram.size(), &amp;senderAddress, &amp;senderPort);
                qDebug() &lt;&lt; "Received datagram from" &lt;&lt; senderAddress.toString() &lt;&lt; ":" &lt;&lt; senderPort &lt;&lt; "-" &lt;&lt; datagram;
    }
    }

</code></pre>
]]></description><link>https://forum.qt.io/topic/147642/udp-communication</link><generator>RSS for Node</generator><lastBuildDate>Tue, 01 Sep 2026 03:48:21 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/147642.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 07 Aug 2023 09:14:45 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to UDP communication on Wed, 09 Aug 2023 11:38:43 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/vijaykarthikeyan">@<bdi>Vijaykarthikeyan</bdi></a> Please now get help from other people than me.  I'm done.</p>
]]></description><link>https://forum.qt.io/post/768144</link><guid isPermaLink="true">https://forum.qt.io/post/768144</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Wed, 09 Aug 2023 11:38:43 GMT</pubDate></item><item><title><![CDATA[Reply to UDP communication on Wed, 09 Aug 2023 11:35:32 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jonb">@<bdi>JonB</bdi></a>  This is the code which successfully ran but without your suggestions and you are accusing me that i knows nothing..That's funny..you people arguing and accusing me that my codes are wrong this wont work that wont work. IT it don't work,why can't you suggest the loophole to be corrected. but,other than this, you guys directing the topic to somewhere else</p>
<p dir="auto">#include "test.h"<br />
#include &lt;QDataStream&gt;<br />
#include &lt;QTimer&gt;<br />
#include &lt;QtNetwork/QUdpSocket&gt;<br />
MainWindow::MainWindow(QWidget *parent)<br />
: QMainWindow(parent)<br />
{<br />
socket = new QUdpSocket(this);<br />
socket-&gt;bind(QHostAddress::LocalHost, receiverPort);<br />
receiveDatagram();<br />
}</p>
<p dir="auto">void MainWindow::receiveDatagram()<br />
{<br />
if (socket-&gt;state() == QUdpSocket::BoundState)<br />
{</p>
<pre><code>    while (socket-&gt;hasPendingDatagrams())
    {
        QHostAddress senderAddress(QHostAddress::LocalHost);
        quint16 senderPort;
        datagram.resize(socket-&gt;pendingDatagramSize());
        socket-&gt;readDatagram(datagram.data(), datagram.size(), &amp;senderAddress, &amp;senderPort);
        //emit data_received(datagram);
        qDebug()&lt;&lt;datagram;
        sendDatagram();
    }
}
</code></pre>
<p dir="auto">}</p>
<p dir="auto">void MainWindow::sendDatagram()</p>
<p dir="auto">{<br />
QHostAddress receiverAddress(QHostAddress::LocalHost);</p>
<pre><code>socket-&gt;writeDatagram(array, receiverAddress, receiverPort);
qDebug() &lt;&lt; "Sent datagram to" &lt;&lt; receiverAddress.toString() &lt;&lt; ":" &lt;&lt; receiverPort &lt;&lt; "-" &lt;&lt;array;
</code></pre>
<p dir="auto">}</p>
]]></description><link>https://forum.qt.io/post/768142</link><guid isPermaLink="true">https://forum.qt.io/post/768142</guid><dc:creator><![CDATA[Vijaykarthikeyan]]></dc:creator><pubDate>Wed, 09 Aug 2023 11:35:32 GMT</pubDate></item><item><title><![CDATA[Reply to UDP communication on Mon, 07 Aug 2023 14:29:17 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/christian-ehrlicher">@<bdi>Christian-Ehrlicher</bdi></a> ok.. now, I corrected my code and finally it works. It's because the mismatch between the Ip address and ports.. I have to use 5 digit port number instead of 4..</p>
]]></description><link>https://forum.qt.io/post/767874</link><guid isPermaLink="true">https://forum.qt.io/post/767874</guid><dc:creator><![CDATA[Vijaykarthikeyan]]></dc:creator><pubDate>Mon, 07 Aug 2023 14:29:17 GMT</pubDate></item><item><title><![CDATA[Reply to UDP communication on Mon, 07 Aug 2023 14:01:06 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/vijaykarthikeyan">@<bdi>Vijaykarthikeyan</bdi></a> said in <a href="/post/767866">UDP communication</a>:</p>
<blockquote>
<p dir="auto">examples in qt documentation explains separate separate modules.</p>
</blockquote>
<p dir="auto">I don't see what this should matter. You should test if it works. Merging the two functions into one class (for whatever abstruse reason) is a no brainer afterwards.</p>
<p dir="auto">Why do you use port 55000 and QHostAddress::Any on the one side and receiver_port and receiver_host on the other?</p>
<p dir="auto">Why do you check for a socket state in your slot? No example does this.</p>
<p dir="auto">How does your debug output look like now?</p>
]]></description><link>https://forum.qt.io/post/767871</link><guid isPermaLink="true">https://forum.qt.io/post/767871</guid><dc:creator><![CDATA[Christian Ehrlicher]]></dc:creator><pubDate>Mon, 07 Aug 2023 14:01:06 GMT</pubDate></item><item><title><![CDATA[Reply to UDP communication on Mon, 07 Aug 2023 13:35:46 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/christian-ehrlicher">@<bdi>Christian-Ehrlicher</bdi></a> i have turned off all the firewall securities,sir..examples in qt documentation explains separate separate modules.Here is the modified code:</p>
<pre><code>#include "sender.h"
#include &lt;QtNetwork/QUdpSocket&gt;
#include &lt;QMessageBox&gt;
#include &lt;exception&gt;
#include &lt;QTimer&gt;
#include &lt;QObject&gt;


Sender::Sender()
    {
        send_socket = new QUdpSocket(this);
        socket = new QUdpSocket(this);
        qDebug()&lt;&lt;socket-&gt;bind(QHostAddress::Any,55000);
        connect(socket, &amp;QUdpSocket::readyRead, this, &amp;Sender::processResponse);
        QTimer* timer = new QTimer(this);
        connect(timer, &amp;QTimer::timeout, this, &amp;Sender::sendDatagram);
        timer-&gt;start(1000); // Adjust the interval as needed (milliseconds)


    }

    void Sender::sendDatagram()
    {
            qDebug()&lt;&lt;send_socket-&gt;writeDatagram(UDP_DATA, receiverAddress, receiverPort);
            qDebug() &lt;&lt; "Sent datagram to" &lt;&lt; receiverAddress.toString() &lt;&lt; ":" &lt;&lt; receiverPort &lt;&lt; "-" &lt;&lt;UDP_DATA;
            //processResponse();
    }

    void Sender::processResponse()
    {   if (socket-&gt;state() == QUdpSocket::BoundState)
            {
                while (socket-&gt;hasPendingDatagrams()) {

                    datagram.resize(socket-&gt;pendingDatagramSize());
                    QHostAddress senderAddress;
                    quint16 senderPort;
                    int bytesRead = socket-&gt;readDatagram(datagram.data(), datagram.size(), &amp;senderAddress, &amp;senderPort);
                    QString data = QString::fromUtf8(datagram);

                    qDebug() &lt;&lt; "Received datagram from" &lt;&lt; senderAddress.toString() &lt;&lt; ":" &lt;&lt; senderPort &lt;&lt; "-" &lt;&lt; data;
                    if (bytesRead == -1)
                    {
                        qDebug() &lt;&lt; "Failed to read datagram!";
                    }
                    else
                    {
                        QString data = QString::fromUtf8(datagram);
                        qDebug() &lt;&lt; "Received datagram from" &lt;&lt; senderAddress.toString() &lt;&lt; ":" &lt;&lt; senderPort &lt;&lt; "-" &lt;&lt; data;

                    }
                }
            }
    }


</code></pre>
]]></description><link>https://forum.qt.io/post/767866</link><guid isPermaLink="true">https://forum.qt.io/post/767866</guid><dc:creator><![CDATA[Vijaykarthikeyan]]></dc:creator><pubDate>Mon, 07 Aug 2023 13:35:46 GMT</pubDate></item><item><title><![CDATA[Reply to UDP communication on Mon, 07 Aug 2023 12:47:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/vijaykarthikeyan">@<bdi>Vijaykarthikeyan</bdi></a> said in <a href="/post/767858">UDP communication</a>:</p>
<blockquote>
<p dir="auto">returns -1 which indicates it is not receiving bytes.  I think the reson why it is not calling the receving function might be due to</p>
</blockquote>
<p dir="auto">This does not match since your code correctly calls readDatagram() when the receive function was called due to readyRead.<br />
Post yor actual code and a proper error description.</p>
<p dir="auto">/edit: also try out the examples and make sure the windows firewall does not block the udp packets</p>
]]></description><link>https://forum.qt.io/post/767860</link><guid isPermaLink="true">https://forum.qt.io/post/767860</guid><dc:creator><![CDATA[Christian Ehrlicher]]></dc:creator><pubDate>Mon, 07 Aug 2023 12:47:19 GMT</pubDate></item><item><title><![CDATA[Reply to UDP communication on Mon, 07 Aug 2023 12:33:36 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/christian-ehrlicher">@<bdi>Christian-Ehrlicher</bdi></a> ok ...i modified it..removed that binding line for sender. on looking through documentation,i have checked the return statement for both writeDatagram() and readDatagram().The former one returns 30 bytes but the latter one returns -1 which indicates it is not receiving bytes.  I think the reson why it is not calling the receving function might be due to the connect function which connects readyRead() with receving function. but upon debugging that also,it gives ture..</p>
<p dir="auto">where can i found the error?</p>
]]></description><link>https://forum.qt.io/post/767858</link><guid isPermaLink="true">https://forum.qt.io/post/767858</guid><dc:creator><![CDATA[Vijaykarthikeyan]]></dc:creator><pubDate>Mon, 07 Aug 2023 12:33:36 GMT</pubDate></item><item><title><![CDATA[Reply to UDP communication on Mon, 07 Aug 2023 12:19:11 GMT]]></title><description><![CDATA[<p dir="auto">When you want to write to a socket there is no need for bind() as written in the <a href="https://doc.qt.io/qt-6/qudpsocket.html#writeDatagram" target="_blank" rel="noopener noreferrer nofollow ugc">documentation</a>. There is even a big red note about it. And the <a href="https://doc.qt.io/qt-6/qudpsocket.html#details" target="_blank" rel="noopener noreferrer nofollow ugc">documentation</a> also show you what to do to receive an udp packet. And moreover you can find two examples there which show your requested functionality.</p>
]]></description><link>https://forum.qt.io/post/767857</link><guid isPermaLink="true">https://forum.qt.io/post/767857</guid><dc:creator><![CDATA[Christian Ehrlicher]]></dc:creator><pubDate>Mon, 07 Aug 2023 12:19:11 GMT</pubDate></item><item><title><![CDATA[Reply to UDP communication on Mon, 07 Aug 2023 11:30:39 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jonb">@<bdi>JonB</bdi></a> Where I have chosen? You said to check the return of writeDatagram().. I thought it is debugging the return byte. How could you tell me that i have chosen not to verify? I have gone through all that documentation ,tried with different ip's. Also they have came out well.. I came here to seek help to clear my doubt? how could you say like this? If the suggestion is clear and I didn't go for that..it is agreeable. But, I have tried all the ways you have said and you are accusing me I'm not interested? Is that the right way of concluding the topic</p>
]]></description><link>https://forum.qt.io/post/767855</link><guid isPermaLink="true">https://forum.qt.io/post/767855</guid><dc:creator><![CDATA[Vijaykarthikeyan]]></dc:creator><pubDate>Mon, 07 Aug 2023 11:30:39 GMT</pubDate></item><item><title><![CDATA[Reply to UDP communication on Mon, 07 Aug 2023 11:21:44 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/vijaykarthikeyan">@<bdi>Vijaykarthikeyan</bdi></a><br />
You have chosen not to verify the <code>writeDatagram()</code> (and for that matter the <code>readDatagram()</code>.  Nor do you check the <code>bind()</code> results.  I also suggested you try with <code>connectToHost()</code>.  I leave this to you now, you have your own way of developing.</p>
]]></description><link>https://forum.qt.io/post/767854</link><guid isPermaLink="true">https://forum.qt.io/post/767854</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Mon, 07 Aug 2023 11:21:44 GMT</pubDate></item><item><title><![CDATA[Reply to UDP communication on Mon, 07 Aug 2023 11:19:06 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jonb">@<bdi>JonB</bdi></a> On looking through documentation writeDatagram() returns the number of bytes it sent..</p>
<p dir="auto">on my case,the number of bytes returned every time are 30:</p>
<p dir="auto">30<br />
Sent datagram to "192.168.0.110" : 4500 - "0,S,M,A,-1,-1,S,S,4000,10000,#"<br />
30<br />
Sent datagram to "192.168.0.110" : 4500 - "0,S,M,A,-1,-1,S,S,4000,10000,#"<br />
30</p>
]]></description><link>https://forum.qt.io/post/767853</link><guid isPermaLink="true">https://forum.qt.io/post/767853</guid><dc:creator><![CDATA[Vijaykarthikeyan]]></dc:creator><pubDate>Mon, 07 Aug 2023 11:19:06 GMT</pubDate></item><item><title><![CDATA[Reply to UDP communication on Mon, 07 Aug 2023 11:15:34 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jonb">@<bdi>JonB</bdi></a> ok..I have changed the mistakes..still receiving function is not working</p>
<pre><code>#include "sender.h"
#include &lt;QtNetwork/QUdpSocket&gt;
#include &lt;QMessageBox&gt;
#include &lt;exception&gt;
#include &lt;QTimer&gt;
#include &lt;QObject&gt;


Sender::Sender()
    {
        send_socket = new QUdpSocket(this);
        socket = new QUdpSocket(this);
        send_socket-&gt;bind(QHostAddress("192.168.0.110"),500);
        socket-&gt;bind(QHostAddress("192.168.0.110"),4500);

        connect(socket, &amp;QUdpSocket::readyRead, this, &amp;Sender::processResponse);

        QTimer* timer = new QTimer(this);
        connect(timer, &amp;QTimer::timeout, this, &amp;Sender::sendDatagram);
        timer-&gt;start(1000); // Adjust the interval as needed (milliseconds)


    }

    void Sender::sendDatagram()
    {
            send_socket-&gt;writeDatagram(UDP_DATA, receiverAddress, receiverPort);
            qDebug() &lt;&lt; "Sent datagram to" &lt;&lt; receiverAddress.toString() &lt;&lt; ":" &lt;&lt; receiverPort &lt;&lt; "-" &lt;&lt;UDP_DATA;
            
    }

    void Sender::processResponse()
    {
     
               if (socket-&gt;hasPendingDatagrams())
                {
                    datagram.resize(socket-&gt;pendingDatagramSize());
                    QHostAddress senderAddress;
                    quint16 senderPort;
                    socket-&gt;readDatagram(datagram.data(), datagram.size(), &amp;senderAddress, &amp;senderPort);
                    QString data = QString::fromUtf8(datagram);

                    qDebug() &lt;&lt; "Received datagram from" &lt;&lt; senderAddress.toString() &lt;&lt; ":" &lt;&lt; senderPort &lt;&lt; "-" &lt;&lt; data;
                }
                else
                {
                    qDebug() &lt;&lt; "No pending datagrams.";
                }
    }
</code></pre>
]]></description><link>https://forum.qt.io/post/767852</link><guid isPermaLink="true">https://forum.qt.io/post/767852</guid><dc:creator><![CDATA[Vijaykarthikeyan]]></dc:creator><pubDate>Mon, 07 Aug 2023 11:15:34 GMT</pubDate></item><item><title><![CDATA[Reply to UDP communication on Mon, 07 Aug 2023 10:42:33 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/vijaykarthikeyan">@<bdi>Vijaykarthikeyan</bdi></a> said in <a href="/post/767850">UDP communication</a>:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jonb">@<bdi>JonB</bdi></a> I have used two sockets- send_socket,socket</p>
</blockquote>
<p dir="auto">The <code>socket</code> (member?) variable you declare in <code>Sender::Sender()</code> and use in <code>processResponse()</code> is not bound/connected, it is simply a default empty socket.  Why should it receive anything you send?  Also you call <code>send_socket-&gt;pendingDatagramSize()</code> but <code> socket-&gt;readDatagram()</code>.</p>
<p dir="auto">If it still doesn't work, maybe try getting/connecting the second socket via <code>connectToHost()</code>?</p>
<blockquote>
<p dir="auto">Also,I couldn't understand the line :</p>
<p dir="auto">Your sending code outputs that unconditionally after writeDatagram() without checking the result code,</p>
<p dir="auto">how to check this,i didnt get it</p>
</blockquote>
<p dir="auto">Look at the documentation for <code>writeDatagram()</code>.  The reason it returns a result is for people to check it....  Same for <code>readDatagram()</code>.</p>
]]></description><link>https://forum.qt.io/post/767851</link><guid isPermaLink="true">https://forum.qt.io/post/767851</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Mon, 07 Aug 2023 10:42:33 GMT</pubDate></item><item><title><![CDATA[Reply to UDP communication on Mon, 07 Aug 2023 10:33:47 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jonb">@<bdi>JonB</bdi></a> I have used two sockets- send_socket,socket</p>
<p dir="auto">Also,I couldn't understand the line :</p>
<p dir="auto">Your sending code outputs that unconditionally after writeDatagram() without checking the result code,</p>
<p dir="auto">how to check this,i didnt get it</p>
]]></description><link>https://forum.qt.io/post/767850</link><guid isPermaLink="true">https://forum.qt.io/post/767850</guid><dc:creator><![CDATA[Vijaykarthikeyan]]></dc:creator><pubDate>Mon, 07 Aug 2023 10:33:47 GMT</pubDate></item><item><title><![CDATA[Reply to UDP communication on Mon, 07 Aug 2023 10:26:57 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/vijaykarthikeyan">@<bdi>Vijaykarthikeyan</bdi></a> said in <a href="/post/767848">UDP communication</a>:</p>
<blockquote>
<p dir="auto">obviously its correct:</p>
</blockquote>
<p dir="auto">How so?  Your sending code outputs that unconditionally after <code>writeDatagram()</code> without checking the result code, so it tells us nothing about whether it was sent.  In the time taken for you to ask about this and me to type a reply you could have made the change to test it.  Up to you.</p>
<p dir="auto">For sending/receiving to same host you might want to read e.g. <a href="https://stackoverflow.com/questions/18584679/testing-udp-on-localhost" target="_blank" rel="noopener noreferrer nofollow ugc">https://stackoverflow.com/questions/18584679/testing-udp-on-localhost</a>.</p>
<p dir="auto">P.S.<br />
I'm not an expert, but maybe you don't receive a datagram on the same socket as you send it on?  Maybe you need to connect a second, separate socket to receive?</p>
]]></description><link>https://forum.qt.io/post/767849</link><guid isPermaLink="true">https://forum.qt.io/post/767849</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Mon, 07 Aug 2023 10:26:57 GMT</pubDate></item><item><title><![CDATA[Reply to UDP communication on Mon, 07 Aug 2023 10:19:11 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jonb">@<bdi>JonB</bdi></a> this line ```<br />
send_socket-&gt;writeDatagram(UDP_DATA, receiverAddress, receiverPort);<br />
qDebug() &lt;&lt; "Sent datagram to" &lt;&lt; receiverAddress.toString() &lt;&lt; ":" &lt;&lt; receiverPort &lt;&lt; "-" &lt;&lt;UDP_DATA;</p>
<pre><code>
gives the output continously..obviously its correct:

Sent datagram to "192.168.0.110" : 4500 - "0,S,M,A,-1,-1,S,S,4000,10000,#"
Sent datagram to "192.168.0.110" : 4500 - "0,S,M,A,-1,-1,S,S,4000,10000,#"
Sent datagram to "192.168.0.110" : 4500 - "0,S,M,A,-1,-1,S,S,4000,10000,#"
Sent datagram to "192.168.0.110" : 4500 - "0,S,M,A,-1,-1,S,S,4000,10000,#"</code></pre>
]]></description><link>https://forum.qt.io/post/767848</link><guid isPermaLink="true">https://forum.qt.io/post/767848</guid><dc:creator><![CDATA[Vijaykarthikeyan]]></dc:creator><pubDate>Mon, 07 Aug 2023 10:19:11 GMT</pubDate></item><item><title><![CDATA[Reply to UDP communication on Mon, 07 Aug 2023 10:07:35 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/vijaykarthikeyan">@<bdi>Vijaykarthikeyan</bdi></a><br />
First thing is to check return result from <code>send_socket-&gt;writeDatagram(UDP_DATA, receiverAddress, receiverPort);</code>.</p>
]]></description><link>https://forum.qt.io/post/767846</link><guid isPermaLink="true">https://forum.qt.io/post/767846</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Mon, 07 Aug 2023 10:07:35 GMT</pubDate></item><item><title><![CDATA[Reply to UDP communication on Mon, 07 Aug 2023 09:36:50 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jonb">@<bdi>JonB</bdi></a> It is only sending. I have also included the receiving function in the same cpp file. both having common host and  port.does it possible to send and receive in same cpp file</p>
]]></description><link>https://forum.qt.io/post/767844</link><guid isPermaLink="true">https://forum.qt.io/post/767844</guid><dc:creator><![CDATA[Vijaykarthikeyan]]></dc:creator><pubDate>Mon, 07 Aug 2023 09:36:50 GMT</pubDate></item><item><title><![CDATA[Reply to UDP communication on Mon, 07 Aug 2023 09:35:25 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/vijaykarthikeyan">@<bdi>Vijaykarthikeyan</bdi></a> And?  What is wrong with that output?</p>
]]></description><link>https://forum.qt.io/post/767843</link><guid isPermaLink="true">https://forum.qt.io/post/767843</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Mon, 07 Aug 2023 09:35:25 GMT</pubDate></item><item><title><![CDATA[Reply to UDP communication on Mon, 07 Aug 2023 09:28:47 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jonb">@<bdi>JonB</bdi></a> Ok.. I removed that line and executed. but, the output is like this :</p>
<p dir="auto">Sent datagram to "192.168.0.110" : 4500 - "0,S,M,A,-1,-1,S,S,4000,10000,#"<br />
Sent datagram to "192.168.0.110" : 4500 - "0,S,M,A,-1,-1,S,S,4000,10000,#"<br />
Sent datagram to "192.168.0.110" : 4500 - "0,S,M,A,-1,-1,S,S,4000,10000,#"<br />
Sent datagram to "192.168.0.110" : 4500 - "0,S,M,A,-1,-1,S,S,4000,10000,#"</p>
]]></description><link>https://forum.qt.io/post/767841</link><guid isPermaLink="true">https://forum.qt.io/post/767841</guid><dc:creator><![CDATA[Vijaykarthikeyan]]></dc:creator><pubDate>Mon, 07 Aug 2023 09:28:47 GMT</pubDate></item><item><title><![CDATA[Reply to UDP communication on Mon, 07 Aug 2023 09:23:51 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/vijaykarthikeyan">@<bdi>Vijaykarthikeyan</bdi></a><br />
My only comment is that you have already bound <code>send_socket</code> in the constructor.  I don't know what you are doing re-binding <code>send_socket</code> during <code>processResponse()</code>, which is called from <code>readyRead()</code> so socket must be already bound correctly?</p>
]]></description><link>https://forum.qt.io/post/767838</link><guid isPermaLink="true">https://forum.qt.io/post/767838</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Mon, 07 Aug 2023 09:23:51 GMT</pubDate></item></channel></rss>