| 51 | // ---------------------------------------------------------------------------------------- |
| 52 | |
| 53 | sockstreambuf_unbuffered::int_type sockstreambuf_unbuffered:: |
| 54 | underflow( |
| 55 | ) |
| 56 | { |
| 57 | if (lastread_next) |
| 58 | { |
| 59 | return lastread; |
| 60 | } |
| 61 | else if (peek != EOF) |
| 62 | { |
| 63 | return peek; |
| 64 | } |
| 65 | else |
| 66 | { |
| 67 | char temp; |
| 68 | if (con.read(&temp,1) != 1) |
| 69 | { |
| 70 | // some error occurred |
| 71 | return EOF; |
| 72 | } |
| 73 | peek = static_cast<unsigned char>(temp); |
| 74 | return peek; |
| 75 | } |
| 76 | } |
| 77 | |
| 78 | // ---------------------------------------------------------------------------------------- |
| 79 |