We have an issue when using dart client to access our api.
After our app is running a while, with calls against the api in the background, we get errors like “too many files open” which means the File Descriptors are running out.
During investigations on the ipad simulator i found out that a lot of connections are in state “established” but are not being closed by the service client.
Result of lsof (The list is much longer but it’s always the same entry)
In the code we have an instance of the jsonserviceclient, which we then use with “normal” get requests
var result = await client.get(request)
I tried to set the Connection Header to close but it didn’t help.
It looks like either the Servicestack client or the HttpClient of Dart is not closing the connection.