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.TzPervasives.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.

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.