dev@grizzly.java.net

Re: OutputWrite write()>=0

From: ÏòÇØÏÍ <fyaoxy_at_gmail.com>
Date: Wed, 25 Jul 2007 16:25:05 +0800

Thank you charlie, I love chocolate:-) (a movie named chocolate factory of
charlie, seemed)

2007/7/24, charlie hunt <charlie.hunt_at_sun.com>:
>
> I will volunteer to file a bug and attach the patch.
>
> charlie ...
>
> ÏòÇØÏÍ wrote:
> > Hi,
> >
> > 2007/7/24, Jeanfrancois Arcand <Jeanfrancois.Arcand_at_sun.com
> > <mailto:Jeanfrancois.Arcand_at_sun.com>>:
> >
> > Hi,
> >
> > ÏòÇØÏÍ wrote:
> > > Hi Jeanfrancois£¬
> > > Do you remember my comments on your blog on grizzly tricks and
> > tips:)
> >
> > Yes :-) Can you file a bug and attach your patch? The patch looks
> good
> > and I will go ahead and apply it once I've a chance.
> >
> >
> > You mean post issues? not sure get "file a bug", As you known, my
> > english is poor, franch too.:)
> >
> > Thanks!!
> >
> > Thank you!!!
> > Your tricks and tips teach me a few newio:)
> >
> >
> > -- Jeanfrancois
> >
> > > I checked out write operation again and give a patch.
> > > maybe you can check it.
> > >
> > > Index:
> > >
> >
> F:/svn/grizzly/modules/grizzly/src/main/java/com/sun/grizzly/util/OutputWriter.java
> >
> > >
> > >
> ===================================================================
> > > ---
> > >
> >
> F:/svn/grizzly/modules/grizzly/src/main/java/com/sun/grizzly/util/OutputWriter.java
> > > (revision 394)
> > > +++
> > >
> >
> F:/svn/grizzly/modules/grizzly/src/main/java/com/sun/grizzly/util/OutputWriter.java
> > > (working copy)
> > > @@ -86,14 +86,13 @@
> > > try {
> > > while ( bb.hasRemaining() ) {
> > > int len = socketChannel.write(bb);
> > > - attempts++;
> > > - if (len < 0){
> > > - throw new EOFException();
> > > - }
> > > -
> > > - bytesProduced += len;
> > > -
> > > - if (len == 0) {
> > > + if (len>0){
> > > + attempts = 0;
> > > + bytesProduced += len;
> > > + }else {
> > > + //handle write count = 0;NOTE write() return result
> > > >=0, no <0 exist.
> > > + attempts++;
> > > +
> > > if ( writeSelector == null ){
> > > writeSelector = SelectorFactory.getSelector();
> > > if ( writeSelector == null){
> > > @@ -111,8 +110,7 @@
> > > } else {
> > > attempts--;
> > > }
> > > - } else {
> > > - attempts = 0;
> > > + //handle write count = 0 end;
> > > }
> > > }
> > > } finally {
> > >
> > >
> > > --
> > > Ö¾´
> > > ÏòÇØÏÍ
> > >
> > >
> > >
> >
> ------------------------------------------------------------------------
> > >
> > >
> >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: dev-unsubscribe_at_grizzly.dev.java.net
> > <mailto:dev-unsubscribe_at_grizzly.dev.java.net>
> > > For additional commands, e-mail: dev-help_at_grizzly.dev.java.net
> > <mailto:dev-help_at_grizzly.dev.java.net>
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe_at_grizzly.dev.java.net
> > <mailto:dev-unsubscribe_at_grizzly.dev.java.net>
> > For additional commands, e-mail: dev-help_at_grizzly.dev.java.net
> > <mailto:dev-help_at_grizzly.dev.java.net>
> >
> >
> >
> >
> > --
> > Ö¾´
> > ÏòÇØÏÍ
>
> --
>
> Charlie Hunt
> Java Performance Engineer
> 630.285.7708 x47708 (Internal)
>
> <http://java.sun.com/docs/performance/>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_grizzly.dev.java.net
> For additional commands, e-mail: dev-help_at_grizzly.dev.java.net
>
>


-- 
Ö¾´
ÏòÇØÏÍ