https://bz.apache.org/bugzilla/show_bug.cgi?id=62635
--- Comment #2 from Dapeng Zhang <zdap...@google.com> --- Thanks Mark for your quick response. It's fair that Tomcat implementation does not support flushBuffer() in non-blocking I/O mode because it's unspecified. May I ask some implementation details about Tomcat? Its behavior in the following scenario will affect whether/how gRPC bi-directional streaming will be supported. I assume a buffer is used for the response output stream even for the non-blocking I/O mode, and the buffer size set by ServletResponse.setBufferSize() before entering into AsyncContext will still be honored after getting into non-blocking I/O mode. It seems the buffer will be automatically flushed if (1) AsyncContext.complete() is called, or (2) the buffer is full, or (3) prior to the moment when WriteListener.onWritePossible() is invoked. However, it seems unspecified in non-blocking I/O mode in the following scenario: While the ServletOutputStream is ready I do some write() operations. Suppose only half of the buffer is used, and suppose the output stream is still ready. Then I will neither write more data to fully fill the buffer nor call AsyncContext.complete(), until the client send something in response to my data in the first half of the buffer. So I need the first half of the buffer to be drained in order to get something from the client. Will the first half of the buffer be automatically flushed in this case? Thanks a lot. -- You are receiving this mail because: You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org