示例#1
0
        public async Task Disconnect()
        {
            this.token = null;
            if (this.socket != null)
            {
                await this.socket.Disconnect();

                this.socket = null;
            }
        }
示例#2
0
        protected async Task <bool> InitializeInternal()
        {
            string socketToken = await this.GetSocketToken();

            if (!string.IsNullOrEmpty(socketToken))
            {
                this.socket = new TreatStreamWebSocketService(this, socketToken);
                await this.socket.Connect();

                return(this.socket.Connected);
            }
            return(false);
        }