While using the application, I encounter the error 'fd_set: file descriptor >= fd_setsize.' Initially, I thought it might be due to creating a new Retrofit object and OkHttpClient every time I make a call to the REST API. However, I refactored it and now I have only a singleton OkHttpClient and Retrofit instances, yet I'm still experiencing this error. I've thoroughly checked the places where I open files and streams to ensure they are closed properly, and everything appears to be correct there. I have no idea what might be causing this error or how to fix it. The issue is that the logcat doesn't show anything specific except for the error mentioned above, and this situation occurs randomly throughout the application
tried refactoring the networking layer and avoiding creating new instances every time I communicate with the backend. I also checked whether all streams are closed after being opened.