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: ServerConfig, initial_state: InitialState, expects_initial_status: bool ) -> Result<Self, ServerError>
pub fn new( poll: Poll, channel: ProxyChannel, scm: ScmSocket, sessions: Rc<RefCell<SessionManager>>, pool: Rc<RefCell<Pool>>, backends: Rc<RefCell<BackendMap>>, http: Option<HttpProxy>, https: Option<HttpsProxy>, tcp: Option<TcpProxy>, server_config: ServerConfig, initial_state: Option<InitialState>, expects_initial_status: bool ) -> Result<Self, ServerError>
pub fn notify_proxys(&mut self, request: WorkerRequest)
sourcepub fn return_listen_sockets(&mut self) -> Result<(), ScmSocketError>
pub fn return_listen_sockets(&mut self) -> Result<(), ScmSocketError>
Send all socket addresses and file descriptors of all proxies, via the scm socket