Skip to content

Latest commit

 

History

History
66 lines (51 loc) · 2.01 KB

nng_http_conn_read_req.3http.adoc

File metadata and controls

66 lines (51 loc) · 2.01 KB

nng_http_conn_read_req(3http)

NAME

nng_http_conn_read_req - read HTTP request

SYNOPSIS

#include <nng/nng.h>
#include <nng/supplemental/http/http.h>

void nng_http_conn_read_req(nng_http_conn *conn, nng_http_req *req,
    nng_aio *aio);

DESCRIPTION

The nng_http_conn_read_req() function starts an asynchronous read from the HTTP connection conn, reading an HTTP request into the req, including all of the related headers.

Note
Any HTTP entity/body data associated with the request is not read automatically. The caller should use nng_http_conn_read_all() to read the entity data, based on the details of the request itself.

This function returns immediately, with no return value. Completion of the operation is signaled via the aio, and the final result may be obtained via nng_aio_result(). That result will either be zero or an error code.

RETURN VALUES

None.

ERRORS

NNG_ECANCELED

The operation was canceled.

NNG_ECLOSED

The connection was closed.

NNG_ECONNRESET

The peer closed the connection.

NNG_ENOMEM

Insufficient free memory to perform the operation.

NNG_ENOTSUP

HTTP operations are not supported.

NNG_ETIMEDOUT

Timeout waiting for data from the connection.