3 * Copyright (C) Igor Sysoev
7 #ifndef _NGX_EVENT_CONNECT_H_INCLUDED_
8 #define _NGX_EVENT_CONNECT_H_INCLUDED_
11 #include <ngx_config.h>
13 #include <ngx_event.h>
16 #define NGX_PEER_KEEPALIVE 1
17 #define NGX_PEER_NEXT 2
18 #define NGX_PEER_FAILED 4
21 typedef struct ngx_peer_connection_s ngx_peer_connection_t;
23 typedef ngx_int_t (*ngx_event_get_peer_pt)(ngx_peer_connection_t *pc,
25 typedef void (*ngx_event_free_peer_pt)(ngx_peer_connection_t *pc, void *data,
29 typedef ngx_int_t (*ngx_event_set_peer_session_pt)(ngx_peer_connection_t *pc,
31 typedef void (*ngx_event_save_peer_session_pt)(ngx_peer_connection_t *pc,
36 struct ngx_peer_connection_s {
37 ngx_connection_t *connection;
39 struct sockaddr *sockaddr;
45 ngx_event_get_peer_pt get;
46 ngx_event_free_peer_pt free;
50 ngx_event_set_peer_session_pt set_session;
51 ngx_event_save_peer_session_pt save_session;
64 /* ngx_connection_log_error_e */
69 ngx_int_t ngx_event_connect_peer(ngx_peer_connection_t *pc);
70 ngx_int_t ngx_event_get_peer(ngx_peer_connection_t *pc, void *data);
74 #endif /* _NGX_EVENT_CONNECT_H_INCLUDED_ */