I have uploaded my demo code here http://speedy.sh/NBSjr/SocketIssue.zip
I have posted questions on StackOverflow here http://stackoverflow.com/questions/23559827/emfile-too-many-open-files-error-while-connecting-to-localserversocket
and Google https://code.google.com/p/android/issues/detail?id=69594
Still got nothing!.
After few hours of pulling my hair out, I remembered Jackpal terminal emulator had some code to close the file descriptor. So I decided to take a look there.
https://github.com/jackpal/Android-Terminal-Emulator/blob/master/jni/termExec.cpp
If you pass the client socket file descriptor to his close function. it closes the connection. However it leaves a error on LogCat.
Please let me know if someone found a better solution.
No comments:
Post a Comment