[
https://issues.apache.org/jira/browse/DIRMINA-503?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12556102#action_12556102
]
Mike Heath commented on DIRMINA-503:
------------------------------------
Are you still seeing the IOException? I wrote a unit test for sending a 1MB
file using FileRegion that passes with my fix when run on Linux.
To explain the logic behind my fix, the IOException gets thrown when the kernel
write buffer is full and FileChannel.transferTo is invoked. With the change I
made, FileChannel.transferTo gets invoked which will either fill the kernel
write buffer or write the remaining data from the file. If the entire
FileRegion has been sent, the file transfer completes. Otherwise, MINA will
wait for a write completion event to resume sending the file. This write
completion event is triggered when data in the kernel write buffer has been
successfully sent over the wire thereby making room in the write buffer for
more data. When the write completion event is processed, we resume sending the
file by again calling FileChannel.transferTo. We know that they kernel write
buffer is not full in this case so the IOException will not be thrown.
If I'm missing something, please let me know. MINA should probably catch the
exception just in case.
> NioProcessor.transferFile needs to catch IOException on Linux
> -------------------------------------------------------------
>
> Key: DIRMINA-503
> URL: https://issues.apache.org/jira/browse/DIRMINA-503
> Project: MINA
> Issue Type: Bug
> Components: Core
> Affects Versions: 2.0.0-M1
> Environment: Linux 2.6.22 Sun JDK 1.6.0_03
> Reporter: Geoff Cadien
> Assignee: Mike Heath
> Priority: Critical
> Fix For: 2.0.0-M1
>
>
> Under Linux FileChannel.transferTo throws an IOException when the socket send
> buffer is full. This causes the sending of a FileRegion to fail. Here is
> the bug report http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5103988
> Even though it is marked as fixed it continues to exist.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.