Can anybody know which method is called when socket is automatically disconneted in NSStreamDelegate ? Because when socket is disconnected then its will again called - (void)stream:(NSStream *)theStream handleEvent:(NSStreamEvent)streamEvent method so it will create lots of problem. Can anybody tell me how to handle socket disconnection ?
Can anybody know which method is called when socket is automatically disconneted in NSStreamDelegate
Share
The method that is called is again
- (void)stream:(NSStream *)theStream handleEvent:(NSStreamEvent)streamEvent. It is up to you to detect which kind of event happened, and to react in a proper way.E.g., consider the following example from Apple’s documentation: