Module Rpc_server


module Rpc_server: sig .. end

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 : session -> Xdr.xdr_value -> unit;
}
type binding =
| Sync of binding_sync
| Async of binding_async
val create : ?program_number:Rtypes.uint4 ->
?version_number:Rtypes.uint4 ->
Unixqueue.event_system ->
connector ->
Rpc.protocol ->
Rpc.mode -> Rpc_program.t -> binding list -> int -> t
val get_event_system : session -> Unixqueue.event_system
val get_connection_id : session -> connection_id
val get_socket_name : session -> Unix.sockaddr
val get_peer_name : session -> Unix.sockaddr
val get_server : session -> t
val get_main_socket_name : t -> Unix.sockaddr
type rule = [ `Accept
| `Accept_limit_length of int * rule
| `Deny
| `Drop
| `Reject ]
val set_session_filter : t -> (Unix.sockaddr -> rule) -> unit
val reply : session -> Xdr.xdr_value -> unit
val reply_error : session -> Rpc.server_error -> unit
val set_exception_handler : t -> (exn -> unit) -> unit
val set_onclose_action : t -> (connection_id -> unit) -> unit
val stop_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 .. end
val set_auth_methods : t -> auth_method list -> unit
val auth_none : auth_method
val auth_too_weak : auth_method
val get_user : session -> string
val get_auth_method : session -> auth_method
val verbose : bool -> unit