[lkml]   [1997]   [Sep]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: how to tell if data is available for a file descriptor

    > I have an open socket and a file descriptor
    > for that socket, how do I tell without reading the
    > data out of the buffer if there is data to be read?

    Use select with a timeout of 0.

    There may be other ways to do this but this is what I use and it's
    real portable.

    > please CC me directly,
    > Thanks,

    > Jerry

    > I know read() tells me how many bytes were read etc...
    > but it also takes the bytes out of the buffer.

    Michael H. Warfield | (770) 985-6132 |
    (The Mad Wizard) | (770) 925-8248 |
    NIC whois: MHW9 | An optimist believes we live in the best of all
    PGP Key: 0xDF1DD471 | possible worlds. A pessimist is sure of it!

     \ /
      Last update: 2005-03-22 13:40    [W:0.017 / U:107.312 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site