ngtcp2_conn_open_bidi_stream

Synopsis

#include <ngtcp2/ngtcp2.h>

int ngtcp2_conn_open_bidi_stream(ngtcp2_conn *conn, int64_t *pstream_id, void *stream_user_data)

ngtcp2_conn_open_bidi_stream() opens new bidirectional stream. The stream_user_data is the user data specific to the stream. The stream ID of the opened stream is stored in *pstream_id.

Application can call this function before handshake completes. For 0-RTT packet, application can call this function after calling ngtcp2_conn_decode_and_set_0rtt_transport_params(). For 1-RTT packet, application can call this function after calling ngtcp2_conn_decode_and_set_remote_transport_params() and ngtcp2_conn_install_tx_key(). If ngtcp2 crypto support library is used, application can call this function after calling ngtcp2_crypto_derive_and_install_tx_key() for 1-RTT packet.

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

NGTCP2_ERR_NOMEM

Out of memory

NGTCP2_ERR_STREAM_ID_BLOCKED

The remote endpoint does not allow stream_id yet.