streambuf::underflow() infinite loop

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Davis King

    streambuf::underflow() infinite loop

    I'm trying to make a stream buffer which reads from a socket and it
    works fine in visual stuiod, borland 5.5.x and g++ 3.2.x but
    I get an infinite loop in g++ 3.0.4! I imagine it's somehow my fault
    though :)

    So I have implemented overflow, xsputn, underflow, uflow, pbackfail and
    xsgetn. I haven't made any buffers as I just
    want it to read and write from the socket immediatly.

    The infinite loop appears when I write cout << mystreambuf; It just
    keeps calling underflow over and over and over...
    All the underflow function doesn't modify the get pointers or anything.
    It just leaves them as null.

    Can anyone help me? (I'll paste some code in if necessary)



    -Davis



Working...