On Jan 16, 2015, at 11:29 AM, Les Mikesell <lesmikesell at gmail.com> wrote:> On Fri, Jan 16, 2015 at 12:21 PM, Warren Young <wyml at etr-usa.com> wrote: >> >> A different fix is to exploit the real-time nature of video camera imagery > > Normally if you care about knowing if the other end of a connection is > gone you could enable keepalives on the socketThat?s also an appropriate fix, especially when the protocol inherently has long periods of idle time, like SSH. In this particular case, I can?t see the need, unless the camera simply doesn?t transmit continuously. (Motion detection, intermittent activation, etc.)
On Fri, Jan 16, 2015 at 11:34:28AM -0700, Warren Young wrote:> On Jan 16, 2015, at 11:29 AM, Les Mikesell <lesmikesell at gmail.com> wrote: > > > On Fri, Jan 16, 2015 at 12:21 PM, Warren Young <wyml at etr-usa.com> wrote: > >> > >> A different fix is to exploit the real-time nature of video camera imagery > > > > Normally if you care about knowing if the other end of a connection is > > gone you could enable keepalives on the socket > > That?s also an appropriate fix, especially when the protocol inherently has long periods of idle time, like SSH. >It's been some time since I've dealt with that sort of problem, but My recollection is that even keepalives won't really work, because they occur only every hour or two. What is needed is as described earlier: allow multiple connection attempts, if you're busy listening for traffic and another connection attempt occurs, especially if it's from the same IP address (but this isn't always the right way, as some senders use a rotating pool of addresses), then accept the new one and close the old one. I suppose this kludge would work too: try sending something on that port, and if the connection is broken, it'll error. then you could open a new one. -- ---- Fred Smith -- fredex at fcshome.stoneham.ma.us ----------------------------- Show me your ways, O LORD, teach me your paths; Guide me in your truth and teach me, for you are God my Savior, And my hope is in you all day long. -------------------------- Psalm 25:4-5 (NIV) --------------------------------
On Fri, Jan 16, 2015 at 1:13 PM, Fred Smith <fredex at fcshome.stoneham.ma.us> wrote:>> > >> > Normally if you care about knowing if the other end of a connection is >> > gone you could enable keepalives on the socket >> >> That?s also an appropriate fix, especially when the protocol inherently has long periods of idle time, like SSH. >> > > It's been some time since I've dealt with that sort of problem, but My > recollection is that even keepalives won't really work, because they > occur only every hour or two.You can control the frequency - and they are sometimes useful to keep otherwise idle connections established through firewalls and NAT gateways that would time out and drop them.> I suppose this kludge would work too: try sending something on that port, > and if the connection is broken, it'll error. then you could open a new > one.The problem here is that if the other end isn't reading from the socket - and a camera probably wouldn't - the writes will just queue up until some buffer is filled. And, without keepalives enabled, you still won't get an error on the write. -- Les Mikesell lesmikesell at gmail.com