Results 1 to 2 of 2

Thread: waitForConnected does not block

  1. #1
    Join Date
    May 2010
    Posts
    2
    Qt products
    Qt4 Qt Jambi
    Platforms
    Unix/X11 Windows

    Default waitForConnected does not block

    First of all let me say that I'm more fluent in Java and I've been using Qt only for a week now.

    I'm creating a server/client application. Server is in Qt and seems to be ok, since I have a client in Java that works ok.
    Now I'm doing a Qt client and that client is getting QAbstractSocket::SocketTimeoutError when I call socket.waitForConnected(25000). The error does not occour after 25 seconds as defined by the method parameter. Why? What can I do to prevent this socket timeout errors?

    I've searched trough posts and did not come up with anything usefull.

    Thanks.

  2. #2
    Join Date
    May 2010
    Posts
    2
    Qt products
    Qt4 Qt Jambi
    Platforms
    Unix/X11 Windows

    Default Re: waitForConnected does not block

    I have to say that I'm using Qt 4.6.2 on Windows XP with SP3.

    I've tried some other things too and if I put a small sleep (for 50 msecs for example) in my code, everything is OK. But puttings sleep aroung my code is not what I want.
    I also found out that I start getting those timeout errors when "netstat -an" has about 4500 opened connection.

Similar Threads

  1. QTcpSocket and waitforconnected 4.4.3.
    By Simo in forum Qt Programming
    Replies: 0
    Last Post: 20th April 2010, 14:56
  2. Block for interactions
    By mpi in forum Qt Programming
    Replies: 1
    Last Post: 30th October 2009, 09:32
  3. Replies: 4
    Last Post: 25th January 2009, 05:40
  4. How to block keyPressEvent ?
    By richardander in forum Qt Programming
    Replies: 1
    Last Post: 24th January 2009, 09:14
  5. New kid on the block
    By wysota in forum General Discussion
    Replies: 2
    Last Post: 4th May 2008, 20:59

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.