Changeset 2254
- Timestamp:
- 21/08/2008 12:05:38 (19 months ago)
- Location:
- box/trunk/lib/common
- Files:
-
- 1 added
- 2 modified
-
IOStream.cpp (modified) (1 diff)
-
IOStream.h (modified) (1 diff)
-
SelfFlushingStream.h (added)
Legend:
- Unmodified
- Added
- Removed
-
box/trunk/lib/common/IOStream.cpp
r217 r2254 239 239 } 240 240 241 241 // -------------------------------------------------------------------------- 242 // 243 // Function 244 // Name: IOStream::Flush(int Timeout) 245 // Purpose: Read and discard all remaining data in stream. 246 // Useful for protocol streams which must be flushed 247 // to avoid breaking the protocol. 248 // Created: 2008/08/20 249 // 250 // -------------------------------------------------------------------------- 251 void IOStream::Flush(int Timeout) 252 { 253 char buffer[4096]; 254 255 while(StreamDataLeft()) 256 { 257 Read(buffer, sizeof(buffer), Timeout); 258 } 259 } 260 261 -
box/trunk/lib/common/IOStream.h
r217 r2254 58 58 bool ReadFullBuffer(void *pBuffer, int NBytes, int *pNBytesRead, int Timeout = IOStream::TimeOutInfinite); 59 59 bool CopyStreamTo(IOStream &rCopyTo, int Timeout = IOStream::TimeOutInfinite, int BufferSize = 1024); 60 void Flush(int Timeout = IOStream::TimeOutInfinite); 60 61 61 62 static int ConvertSeekTypeToOSWhence(int SeekType);
