[Interest] QTcpServer - One connection per port

Andre Haupt andre at bitwigglers.org
Tue Jun 12 12:17:48 CEST 2012


On Tue, Jun 12, 2012 at 02:44:54PM +0530, Gopalakrishna Bhat wrote:
> Hi,
> 
> I am trying to use QTcpServer to accept connection from only one client at
> a time, but i'm not able to do so.
> 
> I tried setting setMaxPendingConnections to one but then
> also waitForConnected on the second client returned true. I want
> waitForConnected to return true only for the first client.
> 
> Any I idea what I am doing wrong?
The docs for QTcpServer state:

"Clients may still able to connect after the server has reached its
 maximum number of pending connections (i.e., QTcpSocket can still emit
 the connected() signal). QTcpServer will stop accepting the new
 connections, but the operating system may still keep them in queue."

I guess that this is the problem that bites you.

cheers,

Andre



More information about the Interest mailing list