directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Trustin Lee <trus...@gmail.com>
Subject Re: [MINA] protocol with long messages
Date Mon, 19 Sep 2005 22:50:12 GMT
Hi Fabien,

2005/9/20, Fabien Le Floc'h <logos01@gmail.com>:
> 
> If we take the case of an HTTP proxy, without StreamIoHandler, It would 
> not be very appropriate to pass a message containing the reference to a 
> temporary file (that would contain the request or response to forward). 
> However there might be ways using some kind of callbacks (and using 
> ByteBuffers). But then I think it does not fit with the MINA protocol 
> vision. Maybe what I want to do should really be done at the IO Level of 
> MINA (which is still useful, if only for the easy threading of NIO it can 
> provide).


Right. I/O layer is another good choice. But you'll have to spend some time 
to implement HTTP protocol on top of I/O layer. 

I have another question, why is it that in the HTTP server example a thread 
> has to be created for each inputstream/outputstream processing? Does not it 
> defeat a bit the use of NIO?


That's because you use old good I/O stream to implement your protocol. But 
all internal I/O operations will be performed asynchronously so the 
execution of newly created thread should be shorter than plain blocking I/O. 
Of course you'll have to use thread pool which were not used in the example 
for brevity. Here's the related article from developerWorks:

http://www-106.ibm.com/developerworks/library/j-nioserver/

http://mail-archives.apache.org/mod_mbox/directory-dev/200504.mbox/%3cNBBBJGEAGJAKLIDBKJOPGEFJALAC.noel@devtech.com%3e

It's really great that you are building an open framework on top of NIO, 
> this is much needed. It's actually quite surprising that there is not much 
> info available on this subject.


Thank you for your generous praise for our project. You're right. There's 
little effort on this subject comparing to its importance. People should 
show their interests more on this kind of frameworks like he or she do for 
web application frameworks. :)

Trustin
-- 
what we call human nature is actually human habit
--
http://gleamynode.net/

Mime
View raw message