Results 1 to 20 of 57

Thread: QSslSocket vs QTcpSocket problem

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #21
    Join Date
    Mar 2011
    Posts
    53
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QSslSocket vs QTcpSocket problem

    Now I see the point and I am slowly moving to the idea you presented. But I have a problem constructing the while loop which is suppose to get the size of the next incoming data I tried this but I know that fails:

    Qt Code:
    1. QByteArray buffer;
    2.  
    3. void Server::onreadyRead()
    4. {
    5. while(buffer.size() < (int)sizeof(quint64))
    6. {
    7. clientSocket->waitForReadyRead(1);
    8. blockSizee.append(clientSocket->readAll());
    9. }
    10. }
    To copy to clipboard, switch view to plain text mode 

    TEST:
    The byte size of the "size information", sended by server, is about 8kB but after first readyRead signal client gets first 4kB, and after second signal buffer meets the while condition and skips it, and I can't get the full right size.
    Last edited by wysota; 7th March 2011 at 23:06. Reason: missing [code] tags

Similar Threads

  1. problem with QTcpSocket
    By Fallen_ in forum Qt Programming
    Replies: 10
    Last Post: 28th November 2010, 11:03
  2. QSslSocket - problem with connecting to the server
    By kremuwa in forum Qt Programming
    Replies: 9
    Last Post: 26th August 2010, 14:40
  3. Problem in QTcpSocket
    By navi1084 in forum Qt Programming
    Replies: 2
    Last Post: 16th October 2008, 12:12
  4. QSslSocket problem
    By The Storm in forum Qt Programming
    Replies: 5
    Last Post: 23rd March 2008, 12:58
  5. problem with QTcpSocket
    By SuperSonik in forum Qt Programming
    Replies: 8
    Last Post: 31st January 2007, 16:00

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
  •  
Qt is a trademark of The Qt Company.