diff options
Diffstat (limited to 'lib/session.ml')
-rw-r--r-- | lib/session.ml | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/session.ml b/lib/session.ml index 94688bc..0abda51 100644 --- a/lib/session.ml +++ b/lib/session.ml @@ -2,10 +2,13 @@ open Lwt.Syntax open Lwt.Infix open Lwt_react +type connection_step = + | Starting_stream of string + type state = | Disconnected | Opening_portal of string - | Connecting of Portal.t + | Connecting of Portal.t * connection_step | Connected of Portal.t * Stream.features (** [create domain config] is a promise containing a signal representing the portal @@ -40,8 +43,8 @@ let create (domain : string) (config : Stream.config) : (state signal * (unit -> (function | Opening_portal domain -> let+ portal = Portal.connect domain - in update (Connecting portal) - | Connecting portal -> connect portal + in update (Connecting (portal, Starting_stream domain)) + | Connecting (portal, _) -> connect portal | _ -> Lwt.return_unit) state >|= S.keep; in state, fun () -> update (Opening_portal domain) |