Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Async servlet writes

Thanks Greg.

One more question: Do we need to use non-blocking writes even with non-blocking sockets? My understanding is that: with non-blocking sockets, we will write to sockets only when it is available to write. So, in that case isReady() will always return true, right?

On Tue, Jul 25, 2017 at 10:31 PM, Greg Wilkins <gregw@xxxxxxxxxxx> wrote:
Sachin,

sendContent has the potential to be a lot more efficient, as it avoids the need for intermediate buffers.  If the content sent is a File mapped buffer, it can even potentially avoid all user space buffers.

cheers


On 20 July 2017 at 18:08, Sachin Kale <sachinpkale@xxxxxxxxx> wrote:
Here, I am trying to compare two methods to write servlet response asynchronously.

1. Using setWriteListener method of ServletOutputStream
- Mostly copied from StandardDataStream example in the Jetty codebase.



2. ​Using sendContent (with Callback) method of HttpOutput
- I haven't implemented it yet.

Is one method better than another or they both perform equally?


-Sachin-

_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users



--


Back to the top