nabto_client_stream_read_some()

DESCRIPTION

Read some bytes from a stream.

Read atleast 1 byte from the stream, unless an error occurs or the stream is eof.

DECLARATION

NABTO_CLIENT_DECL_PREFIX void NABTO_CLIENT_API
nabto_client_stream_read_some(NabtoClientStream* stream, NabtoClientFuture* future, void* buffer, size_t bufferLength, size_t* readLength)

PARAMETERS

stream:
[in] The stream to read bytes from
future:
[in] The future that resolves when the read completes or fails.
buffer:
[out] The buffer where bytes is copied to. It needs to be kept available until the future resolves.
bufferLength:
[in] The length of the output buffer.
readLength:
[out] The actual number of read bytes. It needs to be kept available until the future resolves.

RETURN VALUES

a future which resolves to ok or a stream error. Future status: NABTO_CLIENT_EC_OK if some bytes was read. NABTO_CLIENT_EC_EOF if stream is eof. NABTO_CLIENT_EC_ABORTED if the stream is aborted. NABTO_CLIENT_EC_OPERATION_IN_PROGRESS if another read is in progress.

EXAMPLES

None.