[Interest] QTcpServer - One connection per port

Gopalakrishna Bhat gopalakbhat at gmail.com
Tue Jun 12 12:48:25 CEST 2012


On Tue, Jun 12, 2012 at 3:47 PM, Andre Haupt <andre at bitwigglers.org> wrote:

> 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.
>

Yeah, that is the reason. I get that signal. Any way we can get my usecase
to work?

Regards,
Gopalakrishna
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20120612/5b0a1f5f/attachment.html>


More information about the Interest mailing list