sig
  exception Connection_lost
  type t
  type session
  type connection_id
  type connector =
      Localhost of int
    | Portmapped
    | Internet of (Unix.inet_addr * int)
    | Unix of string
    | Descriptor of Unix.file_descr
    | Dynamic_descriptor of (unit -> Unix.file_descr)
  type binding_sync = {
    sync_name : string;
    sync_proc : Xdr.xdr_value -> Xdr.xdr_value;
  }
  type binding_async = {
    async_name : string;
    async_invoke : Rpc_server.session -> Xdr.xdr_value -> unit;
  }
  type binding =
      Sync of Rpc_server.binding_sync
    | Async of Rpc_server.binding_async
  val create :
    ?program_number:Rtypes.uint4 ->
    ?version_number:Rtypes.uint4 ->
    Unixqueue.event_system ->
    Rpc_server.connector ->
    Rpc.protocol ->
    Rpc.mode ->
    Rpc_program.t -> Rpc_server.binding list -> int -> Rpc_server.t
  val get_event_system : Rpc_server.session -> Unixqueue.event_system
  val get_connection_id : Rpc_server.session -> Rpc_server.connection_id
  val get_socket_name : Rpc_server.session -> Unix.sockaddr
  val get_peer_name : Rpc_server.session -> Unix.sockaddr
  val get_server : Rpc_server.session -> Rpc_server.t
  val get_main_socket_name : Rpc_server.t -> Unix.sockaddr
  type rule =
    [ `Accept
    | `Accept_limit_length of int * Rpc_server.rule
    | `Deny
    | `Drop
    | `Reject ]
  val set_session_filter :
    Rpc_server.t -> (Unix.sockaddr -> Rpc_server.rule) -> unit
  val reply : Rpc_server.session -> Xdr.xdr_value -> unit
  val reply_error : Rpc_server.session -> Rpc.server_error -> unit
  val set_exception_handler : Rpc_server.t -> (exn -> unit) -> unit
  val set_onclose_action :
    Rpc_server.t -> (Rpc_server.connection_id -> unit) -> unit
  val stop_server : Rpc_server.t -> unit
  type auth_result =
      Auth_positive of (string * string * string)
    | Auth_negative of Rpc.server_error
  type auth_peeker = Unix.file_descr -> string option
  class type auth_method =
    object
      method authenticate :
        Rpc_server.t ->
        Rpc_server.connection_id ->
        Unix.file_descr ->
        Unix.sockaddr ->
        Unix.sockaddr ->
        string ->
        string ->
        string -> string -> (Rpc_server.auth_result -> unit) -> unit
      method flavors : string list
      method name : string
      method peek : Rpc_server.auth_peeker option
    end
  val set_auth_methods : Rpc_server.t -> Rpc_server.auth_method list -> unit
  val auth_none : Rpc_server.auth_method
  val auth_too_weak : Rpc_server.auth_method
  val get_user : Rpc_server.session -> string
  val get_auth_method : Rpc_server.session -> Rpc_server.auth_method
  val verbose : bool -> unit
end