On Wed, 2007-12-05 at 12:25 -0500, Sam Berlin wrote: > Not exactly, no. A persistent connection doesn't imply a lock/step of > request/response. As another example, consider a protocol like > BitTorrent or Gnutella. You send packets to a host and read packets > from a host, but the messages don't happen in sequence. A persistent > connection is necessary (because it's long-lived, and knowing you've > disconnected is important), but there's no concept of a "request" and > "response" -- just arbitrary messages sent & read from the pipeline. > > Anyways... this is straying far off topic from HttpComponents. I just > wanted remind Oleg that NIO does have it's uses and reasons in many > situations. :) >
Sam, I was not trying to say NIO did not have its unique uses and reasons. There are many protocols that can benefit greatly from non-blocking I/O. However, in case of HTTP things are not that simple. Blocking I/O can pump data much faster and therefore _potentially_ can lead to a better overall performance _provided_ the application design allows for some flexibility in the connection management. HTTP allows both endpoints to drop idle connections at any point of time, thus releasing the associated worker threads. There are situations where one just does not have this luxury, for instance in case of HTTP proxies or gateways with high request/response latency, and this is where NIO can come very useful. The main point I was trying to make that one ought to pick a system architecture based on specific requirements of a particular system / application rather than perceived coolness of a particular technology. Oleg PS: I know, people sometimes choose things that are not strictly necessary but look good on the CV. I am guilty of doing the same ;-) > Sam > > On 12/5/07, Ortwin Glück <[EMAIL PROTECTED]> wrote: > > > > > > Sam Berlin wrote: > > > I don't think a typical browser is capable of > > > handling this, but if you could code your own Socket handling, it is > > > useful. > > > > You mean, to use a connection-less protocol like UDP for instance. > > > > -- > > [web] http://www.odi.ch/ > > [blog] http://www.odi.ch/weblog/ > > [pgp] key 0x81CF3416 > > finger print F2B1 B21F F056 D53E 5D79 A5AF 02BE 70F5 81CF 3416 > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
