streambuf::underflow() infinite loop

Discussion in 'C++' started by Davis King, Jul 23, 2003.

  1. Davis King

    Davis King Guest

    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
    Davis King, Jul 23, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Wolfgang
    Replies:
    4
    Views:
    5,095
    Andrew Hobbs
    Feb 24, 2004
  2. Peter Jansson
    Replies:
    1
    Views:
    493
    David Rubin
    Nov 8, 2004
  3. Replies:
    5
    Views:
    579
    benben
    Jan 31, 2006
  4. Christopher Pisz
    Replies:
    2
    Views:
    587
    James Kanze
    Dec 12, 2007
  5. Isaac Won
    Replies:
    9
    Views:
    342
    Ulrich Eckhardt
    Mar 4, 2013
Loading...

Share This Page