Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-26475

QTcpSocket infinit loop when do socket.write in "not connected" state.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Not Evaluated Not Evaluated
    • None
    • 4.8.1
    • Network: Sockets
    • None
    • fedora 17 (x86) with qt 4.8.1
      fedora 12 (x86) with qt 4.7.2

      if after connecting to unreachable host we write something to socket it will report this error in infinite loop:

      "QNativeSocketEngine::write() was not called in AbstractSocket::ConnectedState
      "

      sample code:

      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
          QTcpSocket socket;
          socket.connectToHost("192.168.1.56",5555);
          socket.write("hello"); 
          return a.exec();
      }
      

      socket also emits error(QAbstractSocket::SocketError) in infinite loop.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            shkearns Shane Kearns
            chezgi abbas ali chezgi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes