aboutsummaryrefslogtreecommitdiff
path: root/portal/portal.mli
blob: f063cd7fb535a06fca86a337bd757e43eacfe17e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
open Markup

exception MalformedStanza of location * Error.t

type t = (signal, async) stream * ((signal, sync) stream option -> unit)

(** This is the XML namespace of the underlying element stream.

    You can rely on it on your code, as an escape hatch, but you should probably not,
    since the Portal interface is supposed to be agnostic.

    Still, bad implementations exist -- Use with care. *)
val xmlns : string

(** [negotiate domain portal] negotiates an open stream between the provided [portal]
    and the XMPP server. It returns the server-assigned [id] of the stream.

    If [from] is specified, the opening stanza is signed with the JID specified. *)
val negotiate : ?from:string -> string -> t -> string Lwt.t

(** [close portal] closes the stream between [portal] and the XMPP server. *)
val close : t -> unit

val connect : string -> t Lwt.t