Given a SelectableChannel c and its SelectionKey k, k.isWritable() returns, whether the channel is ready to accept calls to write().
However, can k.isWritable() return true if the channel accepts writes, but OP_WRITE isn’t set in interestOps?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No, ready ops is subset of interest ops. if key isn’t interested in write, selector will not set its write ready op (which does not mean it cannot accept write. you can call write() anytime. with write-ready, write() is very likely to succeed, but there’s not guarantee there either)