submitPushPromise

Submits PUSH_PROMISE frame.

The |stream_id| must be client initiated stream ID.

The |hfa| is an array of HeaderField with |hfa.length| elements. The application is responsible to include required pseudo-header fields (header field whose name starts with ":") in |hfa| and must place pseudo-headers before regular header fields.

This function creates copies of all header fieldss in |hfa|. It also lower-cases all names in |hfa|. The order of elements in |hfa| is preserved.

The |promised_stream_user_data| is a pointer to an arbitrary data which is associated to the promised stream this frame will open and make it in reserved state. It is available using Session.getStreamUserData. The application can access it in Connector.onFrameHeader and Connector.onFrameSent of this frame.

The client side is not allowed to use this function.

To submit response headers and data, use submitResponse().

This function returns assigned promised stream ID if it succeeds, or one of the following negative error codes:

ErrorCode.PROTO This function was invoked when Session is initialized as client. ErrorCode.STREAM_ID_NOT_AVAILABLE No stream ID is available because maximum stream ID was reached. ErrorCode.INVALID_ARGUMENT The |stream_id| is 0; The |stream_id| does not designate stream that peer initiated.

.. warning::

This function returns assigned promised stream ID if it succeeds. But that stream is not opened yet. The application must not submit frame to that stream ID before Connector.onFrameHeader is called for this frame.

int
submitPushPromise

Meta