[Qt-interest] QUdp sockets stops receiving after a while

Arnold Krille arnold at arnoldarts.de
Thu Feb 25 10:06:54 CET 2010


Hi,

On Thursday 25 February 2010 08:06:57 David Boosalis wrote:
> I have a QUdpSocket that gets data just fine for quite some time, the data
> is coming in fairly fast at every 100 miliseconds over the internet.  But
> then after receiving a lot of messages (Sometimes a lot is 4,000 messages,
> sometimes it is over 8000 messages) it just stops receiving all messages.
> 
> The server acts as the client and connects to the client for sending UPD
> sockets.  The server (I mean the client) still thinks it is connected and
> sends data on its UdpSocket.  It's QUdpSocket::state also reports that it
>  is connected.   The problem is on Windows and Linux

"Connected" with udp just means that QUdpSocket has a default host:port to 
send datagrams to. Nothing more.
Udp doesn't care whether the datagrams reach the other side or not. And there 
is no connection to establish.

If you want a reliable connection between two apps/machines, use a tcp 
connection.

Regarding the udp problem: Maybe watch the network-traffic on the receiving side 
with either a simple traffic monitor or with a real inspection tool/sniffer to 
verify whether its your app that isn't receiving any more or if its the sender 
not sending any more. Or if its a router in between blocking the traffic for 
junk.
And watch the size of your datagrams, the bigger the datagram the lower its 
chance of being scheduled for sending.

Have fun,

Arnold
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100225/b99f9476/attachment.bin 


More information about the Qt-interest-old mailing list