You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Emmanuel Lecharny (JIRA)" <ji...@apache.org> on 2012/07/10 17:43:35 UTC
[jira] [Resolved] (DIRMINA-671) AbstractPollingIoProcessor
[ https://issues.apache.org/jira/browse/DIRMINA-671?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Emmanuel Lecharny resolved DIRMINA-671.
---------------------------------------
Resolution: Not A Problem
This is the only way in MINA 2 we can get the number of sent messages
> 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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira