0

I'm working with Linux UDP sockets and need to identify scenarios where socket descriptors become invalid due to OS intervention rather than application errors, i.e. where the application can get EBADF/ENOTASOCK error, with no fault of application.

I have gone through the sockets API, but couldn't find anything specific mentioned about socket resources getting reclaimed/closed by the OS.

4
  • Do you have reason to believe such a thing can happen? Commented Sep 26 at 20:09
  • I can't think of any reason why this would happen for any kind of socket, not just UDP. Commented Sep 27 at 21:40
  • @Shawn and Barmar: We wanted to understand under what circumstances (if any - even if rare) - can OS proactively claim the resources (like socket fd)? For example in certain OS like iOS when a process goes into background and process gets treated as INACTIVE - the socket resources are claimed by the OS. Commented Sep 29 at 7:07
  • 1
    See stackoverflow.com/q/28015859/1216776 Commented Sep 29 at 14:03

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.