When using on .NET6 It does stack overflow exception when league client opens or closes when the app is opened.
Possible fixes
I tried to remove the line which connects to the websocket socketConnection.Send($"[5, \"OnJsonApiEvent\"]"); and it worked but no websockets support then.
Another possible fix is by waiting till the client is fully open and then send the subscribe string and send unsubscribe before the app closes
Whenever i join a Aram game the Websocket causing a Stackoverflow, this does not happen when i comment socketConnection.Send($"[5, "OnJsonApiEvent"]"); out but then i can not listen to websocket events. I tried Using .NET 7, .NET 6 and .Net Core 3.1. In all cases it resulted in a stackoverflow after the champion selection
Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
at PoniLCU.LeagueClient.Request(requestMethod method, String url, Object body)
at lolData.LolClient.gameCollect() in F:\reps\lolData\LolClient.cs:line 261