Results 1 to 10 of 10

Thread: Read from QTcpSocket results irregular/wrong data

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Read from QTcpSocket results irregular/wrong data

    Quote Originally Posted by dynup View Post
    Accordingly I have all data in my file!
    No, you don't. A simple example, just looking at this code:

    Qt Code:
    1. if (data.contains("=yend")) {
    2. tcpSocket->close();
    3. }
    To copy to clipboard, switch view to plain text mode 

    What if you first get "=y" and then next time readRead() is emitted, you get "end"? data.contains("=yend") is false in both cases however you have received "=yend".
    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.


  2. The following user says thank you to wysota for this useful post:

    dynup (12th June 2012)

Similar Threads

  1. Replies: 1
    Last Post: 18th October 2010, 16:07
  2. QTcpSocket read duplicate data, but only on "bad channel"
    By creatron in forum Qt Programming
    Replies: 1
    Last Post: 24th May 2010, 19:17
  3. Replies: 1
    Last Post: 24th March 2010, 08:15
  4. Problem in printing the data return /read from QTcpsocket
    By skumar434 in forum Qt Programming
    Replies: 3
    Last Post: 20th February 2009, 19:36
  5. Irregular data and QwtPlotSpectrogram
    By seveninches in forum Qwt
    Replies: 1
    Last Post: 27th January 2008, 10:52

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.