users@grizzly.java.net

Re: TCPConnectorHandler

From: Jeanfrancois Arcand <Jeanfrancois.Arcand_at_Sun.COM>
Date: Thu, 31 May 2007 13:18:25 -0400

Salut,

Oleksiy Stashok wrote:
> Hello,
>
> I agree, for OP_WRITE it makes sense, for OP_READ - not.

patch applied to OP_WRITE.

A+

-- Jeanfrancois

>
> WBR,
> Alexey.
>
> Jeanfrancois Arcand wrote:
>> Hi Karsten,
>>
>> Karsten Ohme wrote:
>>> Hi,
>>>
>>> in TCPConnectorhandler in the read and write methods the key is only
>>> reattached if 0 is returned by the read and write method. It would
>>> make more sense if the key is reregistered if not all remaining bytes
>>> are written.
>>>
>>> instead of:
>>>
>>> if (nWrite == 0){
>>> key.attach(callbackHandler);
>>> selectorHandler.register(key,SelectionKey.OP_WRITE);
>>> }
>>> better:
>>>
>>> if (byteBuffer.hasRemaining()){
>>> key.attach(callbackHandler);
>>> selectorHandler.register(key,SelectionKey.OP_WRITE);
>>> }
>>
>> I agree. Will apply your patch.
>>
>> Thanks
>>
>> -- Jeanfrancois
>>
>>
>>>
>>> Regards,
>>> Karsten
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
>>> For additional commands, e-mail: users-help_at_grizzly.dev.java.net
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
>> For additional commands, e-mail: users-help_at_grizzly.dev.java.net
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
> For additional commands, e-mail: users-help_at_grizzly.dev.java.net
>