[jetty-users] Buffers in Jetty 8

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[jetty-users] Buffers in Jetty 8

Polina Koleva
I use Jetty 8. I want to know when I use SelectChannelConnector what kind of buffers are use? Is it NIO buffers from java.nio.Buffer or  buffers from jetty.io?

Thanks, Polina 

_______________________________________________
jetty-users mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-users
Reply | Threaded
Open this post in threaded view
|

Re: [jetty-users] Buffers in Jetty 8

Greg Wilkins-3
Polina,

both!  in jetty-8 the jetty-io  buffers are an abstraction over either byte arrays or NIO ByteBuffers.   If you are using SelectChannelConnector, then you are using NIO ByteBuffers wrapped as jetty io Buffers.

cheers



On 16 September 2013 17:15, Полина Колева <[hidden email]> wrote:
I use Jetty 8. I want to know when I use SelectChannelConnector what kind of buffers are use? Is it NIO buffers from java.nio.Buffer or  buffers from jetty.io?

Thanks, Polina 

_______________________________________________
jetty-users mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-users




--
Greg Wilkins <[hidden email]>
http://www.webtide.com
Developer advice and support from the Jetty & CometD experts.
Intalio, the modern way to build business applications.

_______________________________________________
jetty-users mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-users
Reply | Threaded
Open this post in threaded view
|

Re: [jetty-users] Buffers in Jetty 8

Polina Koleva
That's helpful. But I wonder why  jetty have two buffers - one for header and one for body of request/response? Is that improve performance and how?

Polina
Reply | Threaded
Open this post in threaded view
|

Re: [jetty-users] Buffers in Jetty 8

Greg Wilkins-3

It is for performance.  

When you start writing content, it initially goes into a buffer.  Once the response is committed, we need to generate a header, which can be of variable size.  So rather than moving the content up in it's buffer we use a separate header buffer and then to a gather write to write the headers and content as a single write.

cheers


On 18 September 2013 17:50, Polina Koleva <[hidden email]> wrote:
That's helpful. But I wonder why  jetty have two buffers - one for header and
one for body of request/response? Is that improve performance and how?

Polina



--
View this message in context: http://jetty.4.x6.nabble.com/jetty-users-Buffers-in-Jetty-8-tp4961212p4961223.html
Sent from the Jetty User mailing list archive at Nabble.com.
_______________________________________________
jetty-users mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-users



--
Greg Wilkins <[hidden email]>
http://www.webtide.com
Developer advice and support from the Jetty & CometD experts.
Intalio, the modern way to build business applications.

_______________________________________________
jetty-users mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-users