pub struct Server {
pub poll: Poll,
/* private fields */
}
Expand description
Server
handles the event loop, the listeners, the sessions and
communication with the configuration channel.
A listener wraps a listen socket, the associated proxying protocols (HTTP, HTTPS and TCP) and the routing configuration for clusters. Listeners handle creating sessions from accepted sockets.
A session manages a “front” socket for a connected client, and all of the associated data (back socket, protocol state machine, buffers, metrics…).
Server
gets configuration updates from the channel (domIN/path routes,
backend server address…).
Listeners and sessions are all stored in a slab structure to index them by a Token, they all have to implement the ProxySession trait.
Fields§
§poll: Poll
Implementations§
source§impl Server
impl Server
pub fn try_new_from_config(
worker_to_main_channel: ProxyChannel,
worker_to_main_scm: ScmSocket,
config: Config,
config_state: ConfigState,
expects_initial_status: bool
) -> Result<Self>
pub fn new(
poll: Poll,
channel: ProxyChannel,
scm: ScmSocket,
sessions: Rc<RefCell<SessionManager>>,
pool: Rc<RefCell<Pool>>,
backends: Rc<RefCell<BackendMap>>,
http: Option<Proxy>,
https: Option<Proxy>,
tcp: Option<Proxy>,
server_config: ServerConfig,
config_state: Option<ConfigState>,
expects_initial_status: bool
) -> Result<Self>
pub fn run(&mut self)
pub fn notify_proxys(&mut self, request: ProxyRequest)
sourcepub fn return_listen_sockets(&mut self)
pub fn return_listen_sockets(&mut self)
Send all socket addresses and file descriptors of all proxies, via the scm socket