Results 1 to 4 of 4

Thread: Non-blocking stream read

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2007
    Location
    Italy
    Posts
    69
    Thanks
    12
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Non-blocking stream read

    Hello,
    does Qt provide some way for reading something from a stream (qtextstream, associated with stdin/stdout) in a non-blocking fashon?

    Here's what i've to do:
    my application checks every N msec if new data has arrived - a timer calls readData(). This method should check if there are new data on the stream for reading. If there aren't, just return, else read the data and process them.

    I'm not using threads and i'd like to avoid them.
    There is some way? (maybe using tell() or something similar?)
    I tried with bytesAvailable() but returns always 0...

    Thanks!

    Edit:
    pos() and size() return always 0, isSequential() returns true, but bytesAvailable() is always 0, too.
    Last edited by akiross; 15th April 2009 at 02:26.

Similar Threads

  1. QFile can't read a file
    By Raccoon29 in forum Qt Programming
    Replies: 3
    Last Post: 11th February 2009, 20:24
  2. External Lib read from QBuffer on Calback problem
    By patrik08 in forum Qt Programming
    Replies: 2
    Last Post: 2nd June 2008, 19:43
  3. Phonon Media Object blocking on play()
    By traetox in forum Qt Programming
    Replies: 0
    Last Post: 21st May 2008, 05:43
  4. How to read CD with read?
    By vishal.chauhan in forum Qt Programming
    Replies: 6
    Last Post: 29th June 2007, 08:20
  5. QIODevice read()
    By ShaChris23 in forum Newbie
    Replies: 1
    Last Post: 3rd May 2007, 00:29

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.