i am currently developing an application for iOS which needs to communicate with a hardware device using a Socket Connection. Therefore i am using a Singleton Object with NSStream. To this point all works as expected.
The problem is if the connection is terminated, or interrupted it is not possible to reopen it (this is stated in the Documentation). So my idea is to destroy the Singleton and recreate it. This should not interfere with the Singleton Pattern, because it states that there only exists one copy of such a class.
Has anyone an idea how to solve this problem? Any other solution not involving the recreation of the singleton would be highly appreciated.