Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Java NIO for pipelined Http

Researching the web, I've found that pipelined HTTP is much faster and more power efficient (specially for mobile devices) than queued or parallel connections. The support from general libraries however seams to be small. Just recently has the widespread Apache HttpCore project gained support through its NIO module.

At least it says so on Wikipedia and a few places in the documentation. My problem is, that I have been unable to find any examples or tutorials on how to use this for sending simple piped requests. Neither the HttpCore NIO docs, nor Google codesearch has given me anything looking like Http pipelining.

Can you give me a simple example on how to use this module for sending two gets in a pipe and responding two their answer?

like image 352
Thomas Ahle Avatar asked Feb 12 '26 23:02

Thomas Ahle


2 Answers

I would wait till Android gets a proper implementation built in. If Google hasn't bothered using it, it might just not be worth all the trouble.

like image 112
Mathias Avatar answered Feb 15 '26 13:02

Mathias


I'm taking a serious look at this right now:

http://www.java2s.com/Code/Java/Network-Protocol/HttpgetwithCharBufferandByteBuffer.htm

like image 28
Susan Avatar answered Feb 15 '26 12:02

Susan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!