You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "boB Gage (JIRA)" <ji...@apache.org> on 2009/10/13 23:53:31 UTC

[jira] Issue Comment Edited: (DIRMINA-720) Hardware Flow Control Disables Serial Port on Windows Platform

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

boB Gage edited comment on DIRMINA-720 at 10/13/09 2:52 PM:
------------------------------------------------------------

Found out a little bit more today ...

The problem does appear to be happening in the session.close process.   And it's apparently two-fold, with issues both in our code and in the Mina layer.


First our code, which I'm looking at ways to fix, has several threads making things happen and shortly after one invalidates the connection and closes the port, a different thread attempts discovery on the next device which re-opens the port.

The second thread is not synchronized with the first and is attempting to open the port before the CloseFuture from session.close() has completed. 

HOWEVER ... the root problem is that the code:
            CloseFuture cf = session.close(true);    // session is an IoSession
            cf.await(30, TimeUnit.SECONDS);

Doesn't work.    As far as I can tell, because the session.close(true) method has not returned.

      was (Author: bgage):
    Found out a little bit more today ...

The problem does appear to be happening in the session.close process.   And it's apparently two-fold, with issues both in our code and in the Mina layer.


First our code, which I'm looking at ways to fix, has several threads making things happen and shortly after one invalidates the connection and closes the port, a different thread attempts discovery on the next device which re-opens the port.

The second thread is not synchronized with the first and is attempting to open the port before the CloseFuture from session.close() has completed. 

HOWEVER ... the root problem is that the code:

  
> 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
>         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.