You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Julien Vermillard (JIRA)" <ji...@apache.org> on 2011/08/30 10:38:53 UTC

[jira] [Updated] (DIRMINA-671) AbstractPollingIoProcessor

     [ https://issues.apache.org/jira/browse/DIRMINA-671?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Julien Vermillard updated DIRMINA-671:
--------------------------------------

    Fix Version/s:     (was: 3.0.0-M1)
                   2.0.6

> AbstractPollingIoProcessor
> --------------------------
>
>                 Key: DIRMINA-671
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-671
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0.0-M4
>            Reporter: Aaron Wald
>            Priority: Minor
>             Fix For: 2.0.6
>
>
> In flushNow() it appears to me that when writeBuffer is called, when the buffer is completely sent, we will always come into the buffer isn't empty check. 
>  if (message instanceof IoBuffer) {
>                    localWrittenBytes = writeBuffer(
>                             session, req, hasFragmentation,
>                             maxWrittenBytes - writtenBytes,
>                             currentTime);
>                     if (localWrittenBytes > 0 && ((IoBuffer)message).hasRemaining() ) {
>                     	// the buffer isn't empty, we re-interest it in writing 
>                     	writtenBytes += localWrittenBytes;    	
>                     	setInterestedInWrite(session, true);
>                         return false;
>                     }
>                 }
> In writeBuffer this is done:
>         if (!buf.hasRemaining() ||
>                 !hasFragmentation && localWrittenBytes != 0) {
>             // Buffer has been sent, clear the current request.
>             buf.reset();
>             fireMessageSent(session, req);
>         }
> fireMessageSent clears the write request, so when we come back after select() we wont double send data but it seems like twice the work is being done.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira