You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by mat <fo...@gmail.com> on 2007/08/15 17:55:33 UTC

Re: How to get MINA to detect a lost connection?

https://issues.apache.org/jira/browse/DIRMINA-354

On 8/16/07, Yigal Rachman <yi...@uvic.ca> wrote:
>
> Hi, Folks:
>
> I have an instrument driver that is built on MINA.  During normal
> operation, it does not write to the instrument, but just listens for
> input from the instrument.  This part works flawlessly with very little
> coding on my part (thanks to MINA).
>
> There is one glitch: if the socket connection is ever lost, the driver
> continues to think it is connected because MINA does not close the
> session.
>
> Any ideas how I can get this to work properly?
>
> Thanks in advance,
> Yigal Rachman
>
> DMAS Data Acquisition Developer
> NEPTUNE Canada
> University of Victoria,
> Victoria, BC, Canada
> www.neptunecanada.ca
>
>
>
>
>

Re: How to get MINA to detect a lost connection?

Posted by Mike Heath <mh...@apache.org>.
Even with "normal" socket programming, you have no way of knowing if the 
connection has been lost until you try to send some data and it fails. 
This is not a problem specific to MINA.

-Mike

Yigal Rachman wrote:
> Hi, Mat:
> 
> Thanks for your amazingly quick response!
> 
> DIRMINA-354 appears to refer to the issue of a "keep-alive" message, 
> which is great if both sides can cooperate on this.  My problem is that 
> the instrument uses a proprietory third-party protocol, over which I 
> have no control.  The instrument expects to be left alone while it is 
> doing its job.
> 
> I was hoping that MINA has some way to detect the loss of the 
> connection, as happens with "normal" socket programming.
> 
> Yigal
> 
> 
> mat wrote:
>> https://issues.apache.org/jira/browse/DIRMINA-354
>>
>> On 8/16/07, Yigal Rachman <yi...@uvic.ca> wrote:
>>   
>>> Hi, Folks:
>>>
>>> I have an instrument driver that is built on MINA.  During normal
>>> operation, it does not write to the instrument, but just listens for
>>> input from the instrument.  This part works flawlessly with very little
>>> coding on my part (thanks to MINA).
>>>
>>> There is one glitch: if the socket connection is ever lost, the driver
>>> continues to think it is connected because MINA does not close the
>>> session.
>>>
>>> Any ideas how I can get this to work properly?
>>>
>>> Thanks in advance,
>>> Yigal Rachman
>>>
>>> DMAS Data Acquisition Developer
>>> NEPTUNE Canada
>>> University of Victoria,
>>> Victoria, BC, Canada
>>> www.neptunecanada.ca
>>>
>>>
>>>
>>>
>>>
>>>     
>>
>>   
> 


Re: How to get MINA to detect a lost connection?

Posted by "Mehmet D. AKIN" <md...@gmail.com>.
AFAIK the only reliable way to detect the loss of connection is having
some sort of keep-alive or heartbeat mechanism for socket
communications.

On 8/15/07, Yigal Rachman <yi...@uvic.ca> wrote:
>
>  Hi, Mat:
>
>  Thanks for your amazingly quick response!
>
>  DIRMINA-354 appears to refer to the issue of a "keep-alive" message, which
> is great if both sides can cooperate on this.  My problem is that the
> instrument uses a proprietory third-party protocol, over which I have no
> control.  The instrument expects to be left alone while it is doing its job.
>
>  I was hoping that MINA has some way to detect the loss of the connection,
> as happens with "normal" socket programming.
>
>  Yigal
>
>
>
>  mat wrote:
>  https://issues.apache.org/jira/browse/DIRMINA-354
>
> On 8/16/07, Yigal Rachman <yi...@uvic.ca> wrote:
>
>
>  Hi, Folks:
>
> I have an instrument driver that is built on MINA. During normal
> operation, it does not write to the instrument, but just listens for
> input from the instrument. This part works flawlessly with very little
> coding on my part (thanks to MINA).
>
> There is one glitch: if the socket connection is ever lost, the driver
> continues to think it is connected because MINA does not close the
> session.
>
> Any ideas how I can get this to work properly?
>
> Thanks in advance,
> Yigal Rachman
>
> DMAS Data Acquisition Developer
> NEPTUNE Canada
> University of Victoria,
> Victoria, BC, Canada
> www.neptunecanada.ca
>
>
>
>
>
>
>
>
>