nabto_device_stream_close()

DESCRIPTION

Close a stream. When a stream has been closed no further data can be written to the stream. Data can however still be read from the stream until the other peer closes the stream.

When close resolves all written data has been acknowledged by the other peer.

Future status:

  • NABTO_DEVICE_OK if the stream is closed for writing.
  • NABTO_DEVICE_ABORTED if the stream is aborted.
  • NABTO_DEVICE_EC_OPERATION_IN_PROGRESS if stream is already being closed.

DECLARATION

NABTO_DEVICE_DECL_PREFIX void NABTO_DEVICE_API
nabto_device_stream_close(NabtoDeviceStream* stream, NabtoDeviceFuture* future)

PARAMETERS

stream:
[in] The stream to close.
future:
[in] Future to resolve when stream is closed or on error.