aboutsummaryrefslogtreecommitdiff
path: root/portal/portal.mli
blob: b46a00fb4a368d83ac20be75be617ba279a98885 (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
25
26
27
open Markup

exception MalformedStanza of location * Error.t

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

type socket

(** 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

(** [header domain portal] sends an initial stream header to the provided [portal] and
    the XMPP server. It returns the server-assigned [id] of the stream included in the
    response stream header.

    When [from] is specified, a from attribute is included. *)
val header : ?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