Results 1 to 1 of 1

Thread: Problem with QAbstractSocket and states.

  1. #1
    Join Date
    Feb 2010
    Posts
    21
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Problem with QAbstractSocket and states.

    Hi.

    I'm working on a irc class using QTcpSocket.

    The class works good, and everything was ok. But now, I working on disconnections.

    I load the application, makes the connection to the server, it works good.
    I disable my network connection to test the disconnection, and the socket object change the states to QAbstractSocket::UnconnectedState.

    My problem is, when I enable the network connection and try to reconnect to the irc server using:
    this->socket->connectToHost(this->host, this->port);
    I receive the next message:
    QAbstractSocket::connectToHost() called when already connecting/connected to "my irc server"
    I check the socket states using the stateChanged signal and several prints of the state() method on the code.

    Any idea of this?
    Thanks in advance

    Edit:

    After try some things. I set abort() on slot for error signal. I try to reconnect ... and everything looks good. But eventually the socket disconnects. When I try a re connect again ... the slots works fine.
    Last edited by nomadscarecrow; 17th March 2010 at 17:10. Reason: more info

Similar Threads

  1. Animation not working on transition between states
    By vfernandez in forum Qt Programming
    Replies: 2
    Last Post: 2nd January 2010, 15:01
  2. Replies: 4
    Last Post: 25th January 2009, 05:40
  3. Replies: 1
    Last Post: 25th February 2008, 10:36
  4. QAbstractSocket::abort() with SIGSEGV
    By mtrpoland in forum Qt Programming
    Replies: 1
    Last Post: 24th February 2008, 17:05
  5. setIcon() - different QIcon states?
    By AaronMK in forum Qt Programming
    Replies: 1
    Last Post: 29th January 2008, 03:10

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.