nghttp2_conn_write
Synopsis
#include <nghttp2v2/nghttp2.h>
-
nghttp2_ssize nghttp2_conn_write(nghttp2_conn *conn, uint8_t *dest, size_t destlen, nghttp2_tstamp ts)
nghttp2_conn_write()writes HTTP/2 frames into the buffer pointed by dest of length destlen. The caller should provide a buffer of 16384 bytes long to just fit into a single TLS record. ts is the current timestamp.If this function returns an error code, the error is unrecoverable, therefore the application should close the underlying connection without calling any nghttp2 API for conn.
This function returns the number of bytes written into the buffer pointed by dest if it succeeds, or one of the following negative error codes:
NGHTTP2_ERR_NOMEMOut of memory.
NGHTTP2_ERR_CALLBACK_FAILUREUser callback failed.
NGHTTP2_ERR_EXCESSIVE_LOADThe remote endpoint exhibits the behavior that causes the excessive load to the local endpoint.
NGHTTP2_ERR_CLOSINGThe connection should be closed because it is terminated by GOAWAY; or the graceful shutdown has completed.