On Sat, 2006-09-16 at 20:54 +0200, Roland Weber wrote: 
> Hi Oleg,
> 

Hi Roland,

> I just did a little code dive to verify my ideas about what
> NIO is doing. As was to be expected, there is a mismatch.
> Maybe you can confirm or correct my understanding of a few
> points:
> 
> AbstractIOReactor has code that deals with a server socket
> channel. So it is exclusively server-side? If that is the case,
> I would suggest a name change to AbstractServerIOReactor.
> 

The SelectionKey.OP_CONNECT handling code will be added at some point.
The premise here is that there is no clear cut distinction between a
server side and a client side I/O reactor responsibilities, as the same
I/O reactor can act as a listener for incoming connections and as a
connector for outgoing connections when, for instance, used in a
proxy.  

> I was a bit puzzled that IOSession has a channel() method
> that returns a ByteChannel, but I just realized that
> java.nio.channels.SocketChannel does implement that interface.
> So IOSession can be used for non-blocking connects on the
> client side.
> 

ByteChannel is perfectly sufficient for what IOSession is supposed to
do, so there is no point coupling IOSession with SocketChannel. Besides,
there can be other non-blocking ByteChannels that are not bound to a
Socket (at least theoretically).

> I found it impossible to understand the roles and relations
> between the interfaces defined in o.a.h.nio without looking
> not only into the implementation classes, but into the examples.
> They seem a little disjointed at the interface level. I've gone
> through Doug Lea's presentation that I linked as PDF in the
> package JavaDocs, but I didn't find the IOSession mentioned
> there.
> 

Was this document of any use at all?

http://wiki.apache.org/jakarta-httpclient/HttpCoreNioApi 

HttpCore NIO is based on Doug Lea's ideas but there are certain
deviations. I did my best to express them in the aforementioned
documents but I do admit I am not much of a writer.

> 
> 
> The chances that I will come up with a patch for HTTPCORE-8
> this weekend have dropped to virtually 0.
> 

HTTPCORE-8 is a difficult one to get right. So, there is no point rushing it.

Cheers

Oleg

> 
> 
> cheers,
>   Roland
> 
> 
> 
> ---------------------------------------------------------------------
> 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]

Reply via email to