Skip to main content

Practice ยท 4 of 4

Debug: The Client Flood

CHALLENGE
Difficulty: intermediate+25 XP

SiteClient news up an HttpClient per call โ€” the graded harness caps sockets and the flood fails. Fix the lifetime: one client for the client object's whole life (injected or lazily created), all calls reuse it. ``csharp public sealed class SiteClient { public string Fetch(string path); // fix: reuse ONE HttpClient } ``

Back to lesson: Practice: HTTP Practice: Handlers, Outcomes, Retries