Uploaded image for project: 'MINA'
  1. MINA
  2. DIRMINA-671

AbstractPollingIoProcessor

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Not A Problem
    • 2.0.0-M4
    • 2.0.6
    • Core
    • None

    Description

      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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            aaronwald Aaron Wald
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: