dev@grizzly.java.net

Re: OutputWrite write()>=0

From: ÏòÇØÏÍ <fyaoxy_at_gmail.com>
Date: Tue, 24 Jul 2007 21:51:40 +0800

Hi,

2007/7/24, Jeanfrancois Arcand <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
> > For additional commands, e-mail: dev-help_at_grizzly.dev.java.net
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_grizzly.dev.java.net
> For additional commands, e-mail: dev-help_at_grizzly.dev.java.net
>
>


-- 
Ö¾´
ÏòÇØÏÍ