streambuf::underflow() infinite loop

D

Davis King

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,678
Members
48,796
Latest member
Greg L.

Latest Threads

Top