<?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[QTcpSocket and QUdpSocket on Windows 10, blocked?]]></title><description><![CDATA[<p dir="auto">Last week I wrote an application using both QTcpSocket and QUdpSocket, both worked without issues, today I started the PC and I'm not aware of any changes that have been made, also I'm wasn't aware of any dialog or prompts, however I have previous experience where on Windows 10 the sockets stop working because of the firewall.</p>
<p dir="auto">Is there a dialog or something I can use to resolve this problem as right now I cannot get the application to communicate.  To be clear, I have two applications both using QTcpSocket and QUdpSocket, QUdpSocket is used to broadcast a heartbeat.</p>
<p dir="auto">There is no activity, nothing is being received the WriteDatagram method returns correctly the number of bytes written to the socket.</p>
]]></description><link>https://forum.qt.io/topic/126955/qtcpsocket-and-qudpsocket-on-windows-10-blocked</link><generator>RSS for Node</generator><lastBuildDate>Tue, 29 Sep 2026 16:24:22 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/126955.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 24 May 2021 18:59:08 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to QTcpSocket and QUdpSocket on Windows 10, blocked? on Tue, 25 May 2021 11:50:51 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/splatten">@<bdi>SPlatten</bdi></a> said in <a href="/post/661478">QTcpSocket and QUdpSocket on Windows 10, blocked?</a>:</p>
<blockquote>
<p dir="auto">Both applications are running on the same laptop, how do I set-up the receiver so it can receive messages broadcast on the same IP and port 30119 ?</p>
</blockquote>
<p dir="auto">Do you want to bind each socket on same port?<br />
So you have allow reusing same port:</p>
<pre><code>if(!pUDPsocket-&gt;bind(QHostAddress::LocalHost, 8124, QAbstractSocket::ShareAddress | QAbstractSocket::ReuseAddressHint))
{
   qWarn() &lt;&lt; "Failed to bind UDP socket:" &lt;&lt; pUDPsocket-&gt;errorString();
}
</code></pre>
]]></description><link>https://forum.qt.io/post/661479</link><guid isPermaLink="true">https://forum.qt.io/post/661479</guid><dc:creator><![CDATA[KroMignon]]></dc:creator><pubDate>Tue, 25 May 2021 11:50:51 GMT</pubDate></item><item><title><![CDATA[Reply to QTcpSocket and QUdpSocket on Windows 10, blocked? on Tue, 14 Feb 2023 20:49:34 GMT]]></title><description><![CDATA[<p dir="auto">You can check the Windows 10 firewall settings to make sure that your applications are allowed through. Just search for ""firewall"" in the Start menu and click on ""Windows Defender Firewall"". From there, you can click on ""Allow an app or feature through Windows Defender Firewall"" and make sure that your applications are checked.</p>
]]></description><link>https://forum.qt.io/post/747646</link><guid isPermaLink="true">https://forum.qt.io/post/747646</guid><dc:creator><![CDATA[DominicLeer]]></dc:creator><pubDate>Tue, 14 Feb 2023 20:49:34 GMT</pubDate></item><item><title><![CDATA[Reply to QTcpSocket and QUdpSocket on Windows 10, blocked? on Wed, 26 May 2021 00:20:15 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/kent-dorfman">@<bdi>Kent-Dorfman</bdi></a> , this is a large corporate company dealing with the ministry of defence they take security and IT very seriously...it does make life very difficult, but they have deep pockets so the cost doesn't hurt them so much.</p>
]]></description><link>https://forum.qt.io/post/661550</link><guid isPermaLink="true">https://forum.qt.io/post/661550</guid><dc:creator><![CDATA[SPlatten]]></dc:creator><pubDate>Wed, 26 May 2021 00:20:15 GMT</pubDate></item><item><title><![CDATA[Reply to QTcpSocket and QUdpSocket on Windows 10, blocked? on Tue, 25 May 2021 16:17:34 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/splatten">@<bdi>SPlatten</bdi></a> said in <a href="/post/661414">QTcpSocket and QUdpSocket on Windows 10, blocked?</a>:</p>
<blockquote>
<p dir="auto">The problem I'm having is the laptop is so locked down by the company IT that I'm not sure if it is causing problems, as I said, last week these same applications were communicating.</p>
</blockquote>
<p dir="auto">And therein is the problem...and it ticks me off to no end.  If you cannot own and control your dev resources then you're just whizzin in the wind when you need to do real work.  These dumb-acre kids who think they know and understand network security need to be taken to the wood shed and whipped with a willow switch when they start treating devs like office admin workers.</p>
]]></description><link>https://forum.qt.io/post/661505</link><guid isPermaLink="true">https://forum.qt.io/post/661505</guid><dc:creator><![CDATA[Kent-Dorfman]]></dc:creator><pubDate>Tue, 25 May 2021 16:17:34 GMT</pubDate></item><item><title><![CDATA[Reply to QTcpSocket and QUdpSocket on Windows 10, blocked? on Tue, 25 May 2021 11:55:42 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/kromignon">@<bdi>KroMignon</bdi></a> , its working :)</p>
]]></description><link>https://forum.qt.io/post/661481</link><guid isPermaLink="true">https://forum.qt.io/post/661481</guid><dc:creator><![CDATA[SPlatten]]></dc:creator><pubDate>Tue, 25 May 2021 11:55:42 GMT</pubDate></item><item><title><![CDATA[Reply to QTcpSocket and QUdpSocket on Windows 10, blocked? on Tue, 25 May 2021 11:54:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/kromignon">@<bdi>KroMignon</bdi></a> , thank you, I literally just added exactly that, compiling now and will try.</p>
]]></description><link>https://forum.qt.io/post/661480</link><guid isPermaLink="true">https://forum.qt.io/post/661480</guid><dc:creator><![CDATA[SPlatten]]></dc:creator><pubDate>Tue, 25 May 2021 11:54:19 GMT</pubDate></item><item><title><![CDATA[Reply to QTcpSocket and QUdpSocket on Windows 10, blocked? on Tue, 25 May 2021 11:50:51 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/splatten">@<bdi>SPlatten</bdi></a> said in <a href="/post/661478">QTcpSocket and QUdpSocket on Windows 10, blocked?</a>:</p>
<blockquote>
<p dir="auto">Both applications are running on the same laptop, how do I set-up the receiver so it can receive messages broadcast on the same IP and port 30119 ?</p>
</blockquote>
<p dir="auto">Do you want to bind each socket on same port?<br />
So you have allow reusing same port:</p>
<pre><code>if(!pUDPsocket-&gt;bind(QHostAddress::LocalHost, 8124, QAbstractSocket::ShareAddress | QAbstractSocket::ReuseAddressHint))
{
   qWarn() &lt;&lt; "Failed to bind UDP socket:" &lt;&lt; pUDPsocket-&gt;errorString();
}
</code></pre>
]]></description><link>https://forum.qt.io/post/661479</link><guid isPermaLink="true">https://forum.qt.io/post/661479</guid><dc:creator><![CDATA[KroMignon]]></dc:creator><pubDate>Tue, 25 May 2021 11:50:51 GMT</pubDate></item><item><title><![CDATA[Reply to QTcpSocket and QUdpSocket on Windows 10, blocked? on Tue, 25 May 2021 11:48:08 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/kromignon">@<bdi>KroMignon</bdi></a> , <a class="plugin-mentions-user plugin-mentions-a" href="/user/jsulm">@<bdi>jsulm</bdi></a> , ok, I've changed the port to 30119 for UDP communications, which seems to work on one application, on the other application that is going to receive the broadcasts and act on them I'm getting:</p>
<pre><code>Failed to bind UDP socket: The bound address is already in use
</code></pre>
<p dir="auto">Both applications are running on the same laptop, how do I set-up the receiver so it can receive messages broadcast on the same IP and port 30119 ?</p>
]]></description><link>https://forum.qt.io/post/661478</link><guid isPermaLink="true">https://forum.qt.io/post/661478</guid><dc:creator><![CDATA[SPlatten]]></dc:creator><pubDate>Tue, 25 May 2021 11:48:08 GMT</pubDate></item><item><title><![CDATA[Reply to QTcpSocket and QUdpSocket on Windows 10, blocked? on Tue, 25 May 2021 11:22:03 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/splatten">@<bdi>SPlatten</bdi></a> said in <a href="/post/661472">QTcpSocket and QUdpSocket on Windows 10, blocked?</a>:</p>
<blockquote>
<p dir="auto">Whats preventing me choosing a port that is in use for something else?</p>
</blockquote>
<p dir="auto">From the link you posted (and what I wrote before): "On Unix-like operating systems, a process must execute with superuser privileges to be able to bind a network socket to an IP address using one of the well-known ports."</p>
]]></description><link>https://forum.qt.io/post/661475</link><guid isPermaLink="true">https://forum.qt.io/post/661475</guid><dc:creator><![CDATA[jsulm]]></dc:creator><pubDate>Tue, 25 May 2021 11:22:03 GMT</pubDate></item><item><title><![CDATA[Reply to QTcpSocket and QUdpSocket on Windows 10, blocked? on Tue, 25 May 2021 11:22:01 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/splatten">@<bdi>SPlatten</bdi></a> said in <a href="/post/661472">QTcpSocket and QUdpSocket on Windows 10, blocked?</a>:</p>
<blockquote>
<p dir="auto">Whats preventing me choosing a port that is in use for something else? For example 13?</p>
</blockquote>
<p dir="auto">As already written by <a class="plugin-mentions-user plugin-mentions-a" href="/user/jsulm">@<bdi>jsulm</bdi></a> , port numbers bellow 1000 are reserved for system. You need to have root rights to bind on them.<br />
This is called security ;)</p>
]]></description><link>https://forum.qt.io/post/661474</link><guid isPermaLink="true">https://forum.qt.io/post/661474</guid><dc:creator><![CDATA[KroMignon]]></dc:creator><pubDate>Tue, 25 May 2021 11:22:01 GMT</pubDate></item><item><title><![CDATA[Reply to QTcpSocket and QUdpSocket on Windows 10, blocked? on Tue, 25 May 2021 11:20:01 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jsulm">@<bdi>jsulm</bdi></a> , I was just looking at:<br />
<a href="https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers#Well-known_ports" target="_blank" rel="noopener noreferrer nofollow ugc">https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers#Well-known_ports</a></p>
<p dir="auto">Whats preventing me choosing a port that is in use for something else? For example 13?</p>
]]></description><link>https://forum.qt.io/post/661472</link><guid isPermaLink="true">https://forum.qt.io/post/661472</guid><dc:creator><![CDATA[SPlatten]]></dc:creator><pubDate>Tue, 25 May 2021 11:20:01 GMT</pubDate></item><item><title><![CDATA[Reply to QTcpSocket and QUdpSocket on Windows 10, blocked? on Tue, 25 May 2021 11:00:08 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/splatten">@<bdi>SPlatten</bdi></a> For ports bellow 10.000 you need privileges (like root on UNIX).</p>
]]></description><link>https://forum.qt.io/post/661469</link><guid isPermaLink="true">https://forum.qt.io/post/661469</guid><dc:creator><![CDATA[jsulm]]></dc:creator><pubDate>Tue, 25 May 2021 11:00:08 GMT</pubDate></item><item><title><![CDATA[Reply to QTcpSocket and QUdpSocket on Windows 10, blocked? on Tue, 25 May 2021 10:57:29 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/kromignon">@<bdi>KroMignon</bdi></a> , thank you, interesting the bind is failing:</p>
<pre><code>Failed to bind UDP socket: The address is protected.
</code></pre>
]]></description><link>https://forum.qt.io/post/661468</link><guid isPermaLink="true">https://forum.qt.io/post/661468</guid><dc:creator><![CDATA[SPlatten]]></dc:creator><pubDate>Tue, 25 May 2021 10:57:29 GMT</pubDate></item><item><title><![CDATA[Reply to QTcpSocket and QUdpSocket on Windows 10, blocked? on Tue, 25 May 2021 10:50:27 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/splatten">@<bdi>SPlatten</bdi></a> said in <a href="/post/661450">QTcpSocket and QUdpSocket on Windows 10, blocked?</a>:</p>
<blockquote>
<p dir="auto">pUDPsocket-&gt;bind(QHostAddress::LocalHost, 8124);</p>
</blockquote>
<p dir="auto">You should verify that bind did work:</p>
<pre><code>if(!pUDPsocket-&gt;bind(QHostAddress::LocalHost, 8124))
{
   qWarn() &lt;&lt; "Failed to bind UDP socket:" &lt;&lt; pUDPsocket-&gt;errorString();
}
</code></pre>
]]></description><link>https://forum.qt.io/post/661466</link><guid isPermaLink="true">https://forum.qt.io/post/661466</guid><dc:creator><![CDATA[KroMignon]]></dc:creator><pubDate>Tue, 25 May 2021 10:50:27 GMT</pubDate></item><item><title><![CDATA[Reply to QTcpSocket and QUdpSocket on Windows 10, blocked? on Tue, 25 May 2021 10:22:54 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/kromignon">@<bdi>KroMignon</bdi></a> , IT unlocked the firewall, I can see that the application that is broadcasting a packet using UDP is appearing on WireShark, but I am still not receiving the packet in the other application which has been unblocked in the firewall.</p>
<p dir="auto">The connection source for this application:</p>
<pre><code>pUDPsocket = new QUdpSocket(this);
pUDPsocket-&gt;bind(QHostAddress::LocalHost, 8124);
QObject::connect(pUDPsocket, &amp;QUdpSocket::readyRead, this, &amp;SckServer::udpRead);
</code></pre>
<p dir="auto">My slot:</p>
<pre><code>void SckServer::udpRead() {
    while( pUDPsocket-&gt;hasPendingDatagrams() ) {
        QNetworkDatagram datagram(pUDPsocket-&gt;receiveDatagram());
        ...
    }
}
</code></pre>
<p dir="auto">It never gets into udpRead...  The IP address resolves to 10.132.55.189 and the port is 8124.</p>
]]></description><link>https://forum.qt.io/post/661450</link><guid isPermaLink="true">https://forum.qt.io/post/661450</guid><dc:creator><![CDATA[SPlatten]]></dc:creator><pubDate>Tue, 25 May 2021 10:22:54 GMT</pubDate></item><item><title><![CDATA[Reply to QTcpSocket and QUdpSocket on Windows 10, blocked? on Tue, 25 May 2021 09:44:49 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/kromignon">@<bdi>KroMignon</bdi></a> , the IT department has just unlocked the app in the firewall...hopefully now it will work.</p>
]]></description><link>https://forum.qt.io/post/661443</link><guid isPermaLink="true">https://forum.qt.io/post/661443</guid><dc:creator><![CDATA[SPlatten]]></dc:creator><pubDate>Tue, 25 May 2021 09:44:49 GMT</pubDate></item><item><title><![CDATA[Reply to QTcpSocket and QUdpSocket on Windows 10, blocked? on Tue, 25 May 2021 09:40:04 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/splatten">@<bdi>SPlatten</bdi></a> said in <a href="/post/661431">QTcpSocket and QUdpSocket on Windows 10, blocked?</a>:</p>
<blockquote>
<p dir="auto">not receiving it on the other application.</p>
</blockquote>
<p dir="auto">On which port+ip have you bind you udp socket?</p>
]]></description><link>https://forum.qt.io/post/661439</link><guid isPermaLink="true">https://forum.qt.io/post/661439</guid><dc:creator><![CDATA[KroMignon]]></dc:creator><pubDate>Tue, 25 May 2021 09:40:04 GMT</pubDate></item><item><title><![CDATA[Reply to QTcpSocket and QUdpSocket on Windows 10, blocked? on Tue, 25 May 2021 08:41:27 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/kromignon">@<bdi>KroMignon</bdi></a> , I'm now seeing the packet broadcast on WireShark, not receiving it on the other application.</p>
]]></description><link>https://forum.qt.io/post/661431</link><guid isPermaLink="true">https://forum.qt.io/post/661431</guid><dc:creator><![CDATA[SPlatten]]></dc:creator><pubDate>Tue, 25 May 2021 08:41:27 GMT</pubDate></item><item><title><![CDATA[Reply to QTcpSocket and QUdpSocket on Windows 10, blocked? on Tue, 25 May 2021 07:21:42 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/kromignon">@<bdi>KroMignon</bdi></a> , yes, presently both the sender and receiving applications are running on the same laptop.</p>
<p dir="auto">The problem I'm having is the laptop is so locked down by the company IT that I'm not sure if it is causing problems, as I said, last week these same applications were communicating.</p>
<p dir="auto">I will try capturing data on WireShark for the UDP port.</p>
<p dir="auto">I've just added filter to WireShark:</p>
<pre><code>udp.port eq 8124
</code></pre>
<p dir="auto">8124 is the port I'm using to broadcast on, I've also modified my source to:</p>
<pre><code>writeDatagram(bytaryDoc, QHostAddress::Broadcast, suint16Port);
</code></pre>
<p dir="auto">Seeing nothing in WireShark.</p>
]]></description><link>https://forum.qt.io/post/661414</link><guid isPermaLink="true">https://forum.qt.io/post/661414</guid><dc:creator><![CDATA[SPlatten]]></dc:creator><pubDate>Tue, 25 May 2021 07:21:42 GMT</pubDate></item><item><title><![CDATA[Reply to QTcpSocket and QUdpSocket on Windows 10, blocked? on Tue, 25 May 2021 06:53:27 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/splatten">@<bdi>SPlatten</bdi></a> said in <a href="/post/661405">QTcpSocket and QUdpSocket on Windows 10, blocked?</a>:</p>
<blockquote>
<p dir="auto">Since the function returns a positive value indicating that It has succeeded, what else can I do?</p>
</blockquote>
<p dir="auto">That's not totally true, positive return value only indicates that message has been "accepted" by TCP/IP stack, that's all.</p>
<p dir="auto">Where are receiver and sender located? on same machine?<br />
Are you sure you are using right network support?<br />
Do you have multiple possible routes between receiver and sender?</p>
<p dir="auto">For WireShark you can start an listening for the UDP port you are using for your "heartbeat" signal. In filter simply enter "upd port xxx" where xxx is the port number (cf <a href="https://wiki.wireshark.org/CaptureFilters" target="_blank" rel="noopener noreferrer nofollow ugc">https://wiki.wireshark.org/CaptureFilters</a> for more details).</p>
]]></description><link>https://forum.qt.io/post/661412</link><guid isPermaLink="true">https://forum.qt.io/post/661412</guid><dc:creator><![CDATA[KroMignon]]></dc:creator><pubDate>Tue, 25 May 2021 06:53:27 GMT</pubDate></item><item><title><![CDATA[Reply to QTcpSocket and QUdpSocket on Windows 10, blocked? on Tue, 25 May 2021 06:17:37 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/kent-dorfman">@<bdi>Kent-Dorfman</bdi></a> , thank you, downloaded and installed on the laptop, here is a screenshot.<br />
<img src="https://ddgobkiprc33d.cloudfront.net/6273f294-e79a-4481-8b2e-a0e5674ed11f.png" alt="wireshark.png" class=" img-fluid img-markdown" /><br />
Not sure what I'm supposed to do now, I've tried the WiFi and I'm not seeing anything that resembles the content I'm sending.  Since the function returns a positive value indicating that It has succeeded, what else can I do?</p>
]]></description><link>https://forum.qt.io/post/661405</link><guid isPermaLink="true">https://forum.qt.io/post/661405</guid><dc:creator><![CDATA[SPlatten]]></dc:creator><pubDate>Tue, 25 May 2021 06:17:37 GMT</pubDate></item><item><title><![CDATA[Reply to QTcpSocket and QUdpSocket on Windows 10, blocked? on Tue, 25 May 2021 01:13:03 GMT]]></title><description><![CDATA[<p dir="auto">If you can run wireshark then you can sniff the traffic to see if the packets are at least getting out of the program.</p>
]]></description><link>https://forum.qt.io/post/661397</link><guid isPermaLink="true">https://forum.qt.io/post/661397</guid><dc:creator><![CDATA[Kent-Dorfman]]></dc:creator><pubDate>Tue, 25 May 2021 01:13:03 GMT</pubDate></item></channel></rss>