This patch implements local exception handling (in
contrast to the previous exception handling that took
place in NioWorker.poll). This results in better
connection state notification capabilities. For
instance, the NioSocket subclasses now receive the
channel closed event in all circumstances (save for
bugs); before, it wouldn't properly detect a connection
closed by the peer among other cases.
In other words, "closed" is now an asynchronous event
and not something one has to be expecting when reading
or a writing. In my opinion, this fits better the model
currently in place.
Some ideas were taken from pkwooster's NIO threads in
Sun's Java Forums.
This patch probably depends on my previous patches, all
of which are available at the project's SourceForge
patch tracker.
Logged In: YES
user_id=68628
I just found out that, as a side effect, closed connection
immediately pass to the CLOSED status instead of remaining
TIME_WAIT (see netstat). That is a good side effect :-)