public async Task Close() { isExit = true; try { await connection.StopAsync(); } catch (Exception ex) { RouteErrorEvent?.Invoke(ex.Message); } }
public async Task Start() { try { await connection.StartAsync(); } catch (Exception ex) { RouteErrorEvent?.Invoke(ex.Message); await Task.Delay(5000); await Start(); } }