Пример #1
0
        public async Task ConnectAsync(ICredentials credentials)
        {
            var token = credentials.As <Token>();

            var realtime = await this.Rpc.StartRealtime(token);

            this.session = this.CreateSession(realtime, token);

            this.Realtime.SocketStatusChanged += e => this.EventReceived?.Invoke(e);
            this.Realtime.EventReceived       += e => this.EventReceived?.Invoke(Mapper.Map(e));

            await this.Realtime.Connect(this.session);
        }