public async Task Disconnect() { this.token = null; if (this.socket != null) { await this.socket.Disconnect(); this.socket = null; } }
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); }