darkfi::rpc::server

Function listen_and_serve

Source
pub async fn listen_and_serve<'a, T: 'a>(
    accept_url: Url,
    rh: Arc<impl RequestHandler<T> + 'static>,
    conn_limit: Option<usize>,
    ex: Arc<Executor<'a>>,
) -> Result<()>
Expand description

Start a JSON-RPC server bound to the givven accept URL and use the given RequestHandler to handle incoming requests.

The supported network schemes can be prefixed with http+ to serve JSON-RPC over HTTP/1.1.