Results 1 to 2 of 2

Thread: QTcpSocket connectionClosed not working correctly

  1. #1
    Join Date
    Feb 2009
    Qt products
    Unix/X11 Windows

    Default QTcpSocket connectionClosed not working correctly

    I've got a problem

    I created a TcpServer and a TcpClient with QTcpServer/Socket.

    When the server disconnects himself from the client with disconnectFromHost(), the client gets a connectionClosed signal .

    But when the client disconnects himself from the server, the server isn't getting the connectionClosed signal.
    I also see that the client tries to disconnect several times from the host, but after 6-7 tries it closes the connection with an abort().
    What's going on?

    the server and client are closing the connection in the exact same manner.
    With disconnectFromHost();

    The host is only sending data and not reading anything
    The client is only sending data and not sending anything
    Last edited by Denarius; 18th March 2009 at 14:40. Reason: spelling error

  2. #2
    Join Date
    Jan 2006
    Warsaw, Poland
    Thanked 5,013 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits

    Default Re: QTcpSocket connectionClosed not working correctly

    Could you prepare a compilable example reproducing the problem?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.

Similar Threads

  1. Drop not working correctly
    By rippa in forum Qt Programming
    Replies: 2
    Last Post: 11th November 2008, 15:13
  2. renderText is not working correctly
    By validator in forum Qt Programming
    Replies: 3
    Last Post: 27th May 2008, 16:55
  3. Strange QTcpSocket behavior (debugged with Ethereal)
    By mdecandia in forum Qt Programming
    Replies: 23
    Last Post: 28th May 2007, 20:44

Tags for this Thread


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.