You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Christophe Graulle <ch...@free.fr> on 2007/01/10 16:12:11 UTC

SocketIoProcessor issue ?

Hi all,

loooong time ago I used Netty 1.9.2 and I solved an issue into the 
so-called "WriteController" in the flush() method.
The issue was a channel.write(buf) returning 0 when the kernel buffer is 
full. At that time i solved it in retrying until there is enough room 
into the buffer and the write does not returns 0.
doFlush().
Today in Mina 1.0.1 the SocketIoProcessor has the same behavior in its 
method doFlush().
The way its is solved in Mina is to set the SeletionKey.OP_WRITE into 
the SelectorKey and let the system manage it. It was alos done like this 
in netty 1.9.2 and did not work.

As I have the same application bahvior when buffer if full I suspect 
that the way it is done in not enough.
Could you confirm that in that case the write will be effectively 
terminated ?
If yes fine, but if not I would suggest to do some retries to let the 
buffer emptying.

Sorry ir was long but I think it was necessary.

Trustin, you may have an idea on that because we talked about that long 
time ago.

Thank you for your help

Christophe


Re: SocketIoProcessor issue ?

Posted by Christophe Graulle <ch...@free.fr>.
Robert,

sorry for my non answer but I got some flue and went to bed.
In fact we are trying another way to avoid getting this issue.
I'll keep you posted when we find something.

Thank you

Christophe

Robert Greig a écrit :
> On 10/01/07, Christophe Graulle <ch...@free.fr> wrote:
>
>> Today in Mina 1.0.1 the SocketIoProcessor has the same behavior in its
>> method doFlush().
>> The way its is solved in Mina is to set the SeletionKey.OP_WRITE into
>> the SelectorKey and let the system manage it. It was alos done like this
>> in netty 1.9.2 and did not work.
>
> What specifically did not work? The code is doing something extremely
> common when using any select/poll I/O framework.
>
>> If yes fine, but if not I would suggest to do some retries to let the
>> buffer emptying.
>
> Registering interest means the socket io processor will know after
> doing a select whether the socket is able to accept data.
>
> RG
>
>


Re: SocketIoProcessor issue ?

Posted by Robert Greig <ro...@gmail.com>.
On 10/01/07, Christophe Graulle <ch...@free.fr> wrote:

> in fact the issue is not to accept new incoming data but to finish the
> transfer of the current ByteBuffer. When the write returns 0 and if the
> buffer has remaining bytes to write it seems they are not written
> resulting in a non completely transmitted buffer.
>
> I tried to test a patch with no success yet.

Do you have a reproducible test case?

We have never seen this behaviour and we have done *lots* of testing with MINA.

RG

Re: SocketIoProcessor issue ?

Posted by Christophe Graulle <ch...@free.fr>.
Hi robert,
*
in fact the issue is not to accept new incoming data but to finish the 
transfer of the current ByteBuffer. When the write returns 0 and if the 
buffer has remaining bytes to write it seems they are not written 
resulting in a non completely transmitted buffer.

I tried to test a patch with no success yet.

Christophe

Robert Greig a écrit :
> On 10/01/07, Christophe Graulle <ch...@free.fr> wrote:
>
>> Today in Mina 1.0.1 the SocketIoProcessor has the same behavior in its
>> method doFlush().
>> The way its is solved in Mina is to set the SeletionKey.OP_WRITE into
>> the SelectorKey and let the system manage it. It was alos done like this
>> in netty 1.9.2 and did not work.
>
> What specifically did not work? The code is doing something extremely
> common when using any select/poll I/O framework.
>
>> If yes fine, but if not I would suggest to do some retries to let the
>> buffer emptying.
>
> Registering interest means the socket io processor will know after
> doing a select whether the socket is able to accept data.
>
> RG
>
>


Re: SocketIoProcessor issue ?

Posted by Robert Greig <ro...@gmail.com>.
On 10/01/07, Christophe Graulle <ch...@free.fr> wrote:

> Today in Mina 1.0.1 the SocketIoProcessor has the same behavior in its
> method doFlush().
> The way its is solved in Mina is to set the SeletionKey.OP_WRITE into
> the SelectorKey and let the system manage it. It was alos done like this
> in netty 1.9.2 and did not work.

What specifically did not work? The code is doing something extremely
common when using any select/poll I/O framework.

> If yes fine, but if not I would suggest to do some retries to let the
> buffer emptying.

Registering interest means the socket io processor will know after
doing a select whether the socket is able to accept data.

RG