EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: RE: TCP connection status : drvAsynIPPort
From: Mark Rivers <[email protected]>
To: "'Eric Norum'" <[email protected]>
Cc: Patel Jignesh <[email protected]>, "[email protected]" <[email protected]>
Date: Thu, 9 Oct 2014 18:43:45 +0000
Yes, I did mean 0-length write.

-----Original Message-----
From: Eric Norum [mailto:[email protected]] 
Sent: Thursday, October 09, 2014 1:42 PM
To: Mark Rivers
Cc: J. Lewis Muir; Torsten Bögershausen; Patel Jignesh; [email protected]
Subject: Re: TCP connection status : drvAsynIPPort


On Oct 9, 2014, at 11:11 AM, Mark Rivers <[email protected]> wrote:

> Hi Lewis,
> 
>> I wouldn't think just reading would work.  If it's just blocking
>> indefinitely in a read, and the hardware it's communicating with is then
>> powered off, for example, I don't think the blocking read will detect
>> that.
> 
> I'm not sure I understand this.  asyn does reads either using poll with a timeout or setting a socket timeout.  If the device is powered off then the recv() will initially timeout return an error like "Device is temporarily unavailable", but if the read is done repeatedly then after some system-dependent period of time the OS will disconnect the socket, and asyn will mark the port as disconnected.
> 
> The problem as I understand it is that some ports on his PLC are "write only", so he is not allowed to do a read.  We wants to do a write that has no side-effects except seeing if the device is connected.
> 
> The best way to do this probably to assume that if one of the read ports is disconnected, then the device is not available, and not try to do it for the write-only ports at all.
> 
> Of course, Jignesh you could try modifying drvAsynIPPort.c to allow a 0-length read and see what you observe.

I think you meant 0-length write.  A 0-length read from a stream socket marks an end-of-file (socket shutdown).   This is why a 0-length write has no effect at the reader.  Whether or not a 0-length write actually generates any network activity and/or tests the connection status seems a bit of a mystery - or at least I infer that from the discussions here.

-- 
Eric Norum
[email protected]



References:
TCP connection status : drvAsynIPPort Patel Jignesh
RE: TCP connection status : drvAsynIPPort Mark Rivers
RE: TCP connection status : drvAsynIPPort Patel Jignesh
RE: TCP connection status : drvAsynIPPort Mark Rivers
Re: TCP connection status : drvAsynIPPort Torsten Bögershausen
Re: TCP connection status : drvAsynIPPort J. Lewis Muir
RE: TCP connection status : drvAsynIPPort Mark Rivers
Re: TCP connection status : drvAsynIPPort Eric Norum

Navigate by Date:
Prev: Re: TCP connection status : drvAsynIPPort Eric Norum
Next: RE: MCA and WAN connection Mark Rivers
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: TCP connection status : drvAsynIPPort Eric Norum
Next: RE: TCP connection status : drvAsynIPPort Patel Jignesh
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 17 Dec 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·