dev@grizzly.java.net

Meeting Minutes, Oct 24, 2007

From: charlie hunt <charlie.hunt_at_sun.com>
Date: Wed, 24 Oct 2007 14:19:20 -0500

> Agenda:
> 1.) Connection caching
> a.) Design and implementation going forward along with backward
compatibility.
> b.) Status of feedback or any outstanding issues with connection
cache tutorial.

Discussion delayed since Alexy was unable to join. The discussion will
continue over the "dev" mailing and also be put on the agenda for the
next meeting.

> 2.) Grizzly integration with GlassFish ORB, any issues?

No issues.

> 3.) Collecting of future Grizzly enhancements.

Jeanfrancois took action item to collect the enhancement request and
either add them to the Project Grizzly web site or add a wiki to Project
Grizzly where they will be placed.

> 4.) Java Symposium 2008 Call For Papers

The Java Symposium 2008 conference is scheduled for March 26-28 in Las
Vegas, Nevada. This looks to be a conference where a presentation on
Grizzly would be good candidate. Jeanfrancois is considering submitting
a session. If anyone else is interested, feel free to do so.

> 5.) Open mic

Charlie asked about how Grizzly's default ReadFilter works once it
receives an OP_READ event until it re-enables interest ops on the
SelectionKey. In particular, under what circumestances does default
ReadFilter do multiple reads?

Looking a ReadFilter.execute(), we see:

                  
94 <https://grizzly.dev.java.net/nonav/xref/com/sun/grizzly/filter/ReadFilter.html#94> /// As soon as bytes are ready, invoke the next ProtocolFilter./
95 <https://grizzly.dev.java.net/nonav/xref/com/sun/grizzly/filter/ReadFilter.html#95> *while* (channel.isOpen() &&
96 <https://grizzly.dev.java.net/nonav/xref/com/sun/grizzly/filter/ReadFilter.html#96> (count = channel.read(byteBuffer)) == 0){
97 <https://grizzly.dev.java.net/nonav/xref/com/sun/grizzly/filter/ReadFilter.html#97>
98 <https://grizzly.dev.java.net/nonav/xref/com/sun/grizzly/filter/ReadFilter.html#98> /// Avoid calling the Selector./
99 <https://grizzly.dev.java.net/nonav/xref/com/sun/grizzly/filter/ReadFilter.html#99> *if* (++loop > 2){
100 <https://grizzly.dev.java.net/nonav/xref/com/sun/grizzly/filter/ReadFilter.html#100> *if* (ctx.getKeyRegistrationState()
101 <https://grizzly.dev.java.net/nonav/xref/com/sun/grizzly/filter/ReadFilter.html#101> != Context.KeyRegistrationState.NONE){
102 <https://grizzly.dev.java.net/nonav/xref/com/sun/grizzly/filter/ReadFilter.html#102> ctx.setAttribute(ProtocolFilter.SUCCESSFUL_READ,
103 <https://grizzly.dev.java.net/nonav/xref/com/sun/grizzly/filter/ReadFilter.html#103> Boolean.FALSE);
104 <https://grizzly.dev.java.net/nonav/xref/com/sun/grizzly/filter/ReadFilter.html#104> invokeNextFilter = false;
105 <https://grizzly.dev.java.net/nonav/xref/com/sun/grizzly/filter/ReadFilter.html#105> }
106 <https://grizzly.dev.java.net/nonav/xref/com/sun/grizzly/filter/ReadFilter.html#106> *break*;
107 <https://grizzly.dev.java.net/nonav/xref/com/sun/grizzly/filter/ReadFilter.html#107> }
108 <https://grizzly.dev.java.net/nonav/xref/com/sun/grizzly/filter/ReadFilter.html#108> }


Hence, we see that Grizzly will read once if it there are bytes read
from the channel. It will try a total of 3 times before giving up.
Also notice that if it reads 3 times and has found no bytes have been
read, the 'invokeNextFilter' is set to false. So this means if bytes had
been read, the next Filter in the chain is invoked. If not, the
ReadFilter will not invoke the next Filter. In both cases, when the
chain of filters have finished executing, the interest op will be
re-enabled on the SelectionKey.

charlie ...