The WebSocket use case requires switching back and forth between blocking and non-blocking writes. (The API defines some writes as non-blocking and others as blocking and they can be called in any order).
On 4/10/13 6:25 PM, Mark Thomas wrote:
The problem I have is that WebSocket requires some writes to be blocking and some non-blocking. With the above limitation I don't see a way to do this. If a container thread does something that triggers a blocking write that can't complete immediately I need a second container thread to call onWritePossible() to enable the first thread to continue.
Mark I do not understand the use case fully. If a write is blocking then why would you invoke the onWritePossible? Also how do you plan to do this using Servlet 3.1 API? If you start using non-blocking IO then you cannot use the traditional blocking write.
[servlet-spec users] [jsr340-experts] Re: NIO specification clarification