[Interest] QTcpServer - One connection per port

Gopalakrishna Bhat gopalakbhat at gmail.com
Tue Jun 12 17:30:24 CEST 2012


On Tue, Jun 12, 2012 at 8:20 PM, BRM <bm_witness at yahoo.com> wrote:

> > From: Gopalakrishna Bhat <gopalakbhat at gmail.com>
>
> >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?
>
>
> Well, the majority of your question has been responded to, but as I have a
> similar use-case, I'll just note that I simply let it accept all the
> incoming connections, and then in my handler of the connections I checked
> if I had one already; if I did, I closed it; it I didn't then the
> application accepted it.
>
> $0.02
>
>
Thanks for the help. I will try it.

Regards,
Gopalakrishna
-- 
My blog http://gkbhat.blogspot.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20120612/7e9f8cfc/attachment.html>


More information about the Interest mailing list