Results 1 to 2 of 2

Thread: QThread, QFile and QTcpSocket freezes GUI

  1. #1
    Join Date
    Feb 2006
    Location
    Warsaw, Poland
    Posts
    45
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default QThread, QFile, QTcpSocket and waitForBytesWritten

    Hi! I have a problem with my app... It's an IM Client with p2p protocol for file transfering. The problem is that when i'm sending files gui totaly freezes... When i'm receiving files everything is fine (progress data is update with signals/slots). The code is available here: http://svn.berlios.de/svnroot/repos/qxygen/ and the file is src/filetransfer/filetransfer.cpp

    Any help would be appreciated

    //EDIT
    Well de gui doesn't freeze but when i'm calling waitForBytesWritten it doesn't work as i suposed it to work. I tested it once more (Adding few small files not one big) And the gui was refreshing but results at "Server" and "Client" are different. i.e. sending (writing to socket) took 2 seconds at server (file 1810,6 kB) and client was receiving it 11 seconds :| How to make sure that client received data to socket?
    Last edited by naresh; 17th May 2006 at 13:14.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QThread, QFile, QTcpSocket and waitForBytesWritten

    Quote Originally Posted by naresh
    sending (writing to socket) took 2 seconds at server (file 1810,6 kB) and client was receiving it 11 seconds
    Most likely it was because of some buffering at OS level.

    Quote Originally Posted by naresh
    How to make sure that client received data to socket?
    You will never know. Unless it sends you an confirmation, but then again the client won't know if you got it, so you will have to send a confirmation of that confirmation, which brings you to the starting point.

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.