package tezos-p2p

  1. Overview
  2. Docs

Welcome worker.

Accept incoming connections and add them to the pool.

type listening_socket_open_failure = {
  1. reason : Unix.error;
    (*

    The error we are re-raising

    *)
  2. address : Tezos_base.P2p_addr.t;
    (*

    The interface we are trying to listen to

    *)
  3. port : int;
    (*

    The port we are trying to listen to

    *)
}

Type discribing an opening failure for the listening socket.

type Tezos_base__TzPervasives.error +=
  1. | Failed_to_open_listening_socket of listening_socket_open_failure

Type of an error in case where the listening socket fails to open.

type t

Type of a welcome worker.

val create : ?addr:Tezos_base.P2p_addr.t -> backlog:int -> ('msg, 'meta, 'meta_conn) P2p_connect_handler.t -> Tezos_base.P2p_addr.port -> (t, Tezos_error_monad.TzCore.error list) Stdlib.result Lwt.t

create ?addr ~backlog pool port returns a running welcome worker adding connections into pool listening on addr:port. backlog is passed to Lwt_unix.listen.

val activate : t -> unit

activate t start the worker that will accept connections

val shutdown : t -> unit Lwt.t

shutdown t returns when t has completed shutdown.

OCaml

Innovation. Community. Security.