mongoc_stream_read (mongoc_stream_t *stream,
- A mongoc_stream_t \&.
- The buffer to read into.
- The number of bytes to read.
- The minimum number of bytes to read, or else indicate failure.
- The number of milliseconds to wait before failure, a timeout of 0 will not block. If negative, use the default timeout.
The mongoc_stream_read function returns the number of bytes read on success. It returns >= 0 and < min_bytes when end-of-file is encountered and -1 on failure. errno is set upon failure.