NSStream does not call it's delegate when closed everytime

282 views Asked by At

I have a couple of NSStreams (in & out TLS) to a server, I can send and receive data via them just fine but after a while maybe 5 minutes after without any traffic, connection seems to be closed on it's own but my delegate does not called with NSStreamEventEndOccured and I only get NSStreamEventErrorOccurred AFTER I try to send something.

COnnection shouldn't close on it's own in the first place because

-app is still active

-device is not locked

-wifi it's using does not disconnect

-Remote server has a long tcp lifetime and SO_KEEPALIVE flag active, iPhone side also SO_KEEPALIVE active on it's native socket handles.

Still, I'm more concerned about why doesn't my delegate get called than my connection getting closed.

Any ideas?

Thanks

0

There are 0 answers