[ 
https://issues.apache.org/jira/browse/DIRMINA-720?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12768259#action_12768259
 ] 

boB Gage commented on DIRMINA-720:
----------------------------------

Rats....    I see RC1 is out and does not include anything similar to:


Index: 
transport-serial/src/main/java/org/apache/mina/transport/serial/SerialSessionImpl.java
===================================================================
--- 
transport-serial/src/main/java/org/apache/mina/transport/serial/SerialSessionImpl.java
      (revision 825265)
+++ 
transport-serial/src/main/java/org/apache/mina/transport/serial/SerialSessionImpl.java
      (working copy)
@@ -22,6 +22,7 @@
 import gnu.io.SerialPort;
 import gnu.io.SerialPortEvent;
 import gnu.io.SerialPortEventListener;
+import gnu.io.UnsupportedCommOperationException;

 import java.io.IOException;
 import java.io.InputStream;
@@ -292,6 +293,11 @@
                 ExceptionMonitor.getInstance().exceptionCaught(e);
             }

+            try {  // Turn flow control off right before close to avoid 
deadlock
+                port.setFlowControlMode(SerialPort.FLOWCONTROL_NONE);
+            } catch (UnsupportedCommOperationException e) {
+                ExceptionMonitor.getInstance().exceptionCaught(e);
+            }
             port.close();
             flush(session);
             synchronized (readReadyMonitor) {


Any hope it'll land in RC2 ??  It *does* fix a known deadlock.

> Hardware Flow Control Disables Serial Port on Windows Platform
> --------------------------------------------------------------
>
>                 Key: DIRMINA-720
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-720
>             Project: MINA
>          Issue Type: Bug
>          Components: Transport
>    Affects Versions: 2.0.0-M4, 2.0.0-M5, 2.0.0-M6, 2.0.0-RC1
>         Environment: Windows, serial connections only
> Specifically does NOT happen on Linux systems (others untested)
>            Reporter: boB Gage
>            Assignee: Julien Vermillard
>
> Attempting protocol discovery on single port -- Most protocols use no flow 
> control, one using RTS/CTS.   Each protocol attempts connection, fails 
> (because far end device turned off), then tries next protocol.    
> Test involves letting discovery fail through multiple cycles (ie test all 
> available protocols) then eventually turn on device and see it get discovered 
> when it's protocol cycles back around.
> HOWEVER...   test failed before first cycle completed, because first protocol 
> using CTS/RTS flow control (via FlowControl.RTSCTS_OUT parameter to 
> SerialAddress constructor) is the last one to successfully open the serial 
> port.
> While the protocol with RTS/CTS works (in that it properly fails), the next, 
> and all following, protocols fail immediately as the port throws a 
> PortInUseException on open attempt.
> Changing FlowControl.RTSCTS_OUT to FlowControl.NONE makes this test run fine. 
>    It also, however, breaks that particular protocol because the far end 
> device expects flow control that it does not see.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to