Go to the source code of this file.
Classes | |
struct | ngx_connection_pool_s |
Structure containing connection pool specyfic data, returned by ngx_connection_pool_create. More... | |
struct | ngx_pooled_connection_s |
Structure containing single connection pooled. Important elements include *data and *connection. More... | |
Typedefs | |
typedef struct ngx_connection_pool_s | ngx_connection_pool_t |
typedef struct ngx_pooled_connection_s | ngx_pooled_connection_t |
Functions | |
ngx_connection_pool_t * | ngx_connection_pool_create (ngx_log_t *_log, struct sockaddr *_sockaddr, ngx_uint_t _sockaddr_size, ngx_uint_t _stored_connections_limit) |
Creates new pool. | |
ngx_int_t | ngx_connection_pool_get (ngx_connection_pool_t *pool, ngx_pooled_connection_t **new_connection, ngx_int_t force_new) |
Fetchs connection from pool. | |
void | ngx_connection_pool_return (ngx_pooled_connection_t *connection) |
Returns connection to pool. It will be released from ngix structures. | |
void | ngx_connection_pool_release (ngx_pooled_connection_t *connection) |
Frees connection without returning it to pool. Must be used if connection has already failed. Do not return broken connections to pool. |
typedef struct ngx_connection_pool_s ngx_connection_pool_t |
typedef struct ngx_pooled_connection_s ngx_pooled_connection_t |
ngx_connection_pool_t* ngx_connection_pool_create | ( | ngx_log_t * | _log, | |
struct sockaddr * | _sockaddr, | |||
ngx_uint_t | _sockaddr_size, | |||
ngx_uint_t | _stored_connections_limit | |||
) |
Creates new pool.
[in] | _log | used to log errors, passed as log parameter when creating new connections |
[in] | _sockaddr | sockaddr structure used by connect |
[in] | _sockaddr_size | size of _sockaddr |
[in] | _stored_connections_limit | Limit for count of connection created. If more connection are needed NGX_ERROR is returned |
ngx_int_t ngx_connection_pool_get | ( | ngx_connection_pool_t * | pool, | |
ngx_pooled_connection_t ** | new_connection, | |||
ngx_int_t | force_new | |||
) |
Fetchs connection from pool.
[in] | pool | pool from which connection will be fetched |
[out] | new_connection | pointer where to store new connection |
[in] | force_new | if set to 1, new connection will always be created (even if there are some connections stored) |
void ngx_connection_pool_release | ( | ngx_pooled_connection_t * | connection | ) |
Frees connection without returning it to pool. Must be used if connection has already failed. Do not return broken connections to pool.
[in] | connection | pool connection to be freed. |
void ngx_connection_pool_return | ( | ngx_pooled_connection_t * | connection | ) |
Returns connection to pool. It will be released from ngix structures.
[in] | connection | pool connection to return to pool. |