submitData

Submits one or more DATA frames to the stream |stream_id|. The data to be sent are provided by |data_prd|. If |flags| contains FrameFlags.END_STREAM, the last DATA frame has END_STREAM flag set.

This function does not take ownership of the |data_prd|. The function copies the members of the |data_prd|.

This function returns 0 if it succeeds, or one of the following negative error codes:

ErrorCode.DATA_EXIST DATA has been already submitted and not fully processed yet. ErrorCode.INVALID_ARGUMENT The |stream_id| is 0. ErrorCode.STREAM_CLOSED The stream was alreay closed; or the |stream_id| is invalid.

.. note::

Currently, only one data is allowed for a stream at a time. Submitting data more than once before first data is finished results in ErrorCode.DATA_EXIST error code. The earliest callback which tells that previous data is done is Connector.onFrameSent. In side that callback, new data can be submitted using submitData(). Of course, all data except for last one must not have FrameFlags.END_STREAM flag set in |flags|.

Meta