GEOS SDK TechDocs
|
|
1.4 Reading Data from a Stream
|
1.6 Miscellaneous Functions
StreamClose()
Either the writer or the reader can instigate stream shutdown by calling
StreamClose()
. When one of the two calls this routine, the shut-down process is started; it will not be completed until the other calls the routine.
If the writer calls
StreamClose()
, it may specify that the data already in the buffer be
flushed
(immediately cleared), or that it
linger
. If you specify that the data should linger, the data will be preserved as long as the reader has the stream open. The reader can continue to read data normally until it runs out of data. The last read-operation will most likely return STREAM_SHORT_READ_WRITE; after that, all attempts to read data will generate the error STREAM_CLOSING. At that point, the reader should call
StreamClose()
. (If the data was flushed by the writer, the next read attempt will return STREAM_CLOSING.)
To shut down the stream, call the routine
StreamClose()
. This routine is passed the following arguments:
GeodeHandle
of the stream driver.
StreamToken
of the stream.If you are using the Serial or Parallel drivers (described later in this chapter), you do not have to coordinate the closure of a stream.
GEOS SDK TechDocs
|
|
1.4 Reading Data from a Stream
|
1.6 Miscellaneous Functions