TIP: Click on subject to list as thread! ANSI
echo: linux-ubuntu
to: ALL
from: RICK CHRISTIAN
date: 2017-04-10 09:46:00
subject: /dev/tcp check for data?

   Hello everybody!

I have a script which I use to poll some data via the kernel /dev/tcp setup...

At times this can have an issue and data stops coming in....

Is there some way am I just not finding to do sort of a "heartbeat" type
thing...

I do something like:

exec 6/dev/tcp/ip/port

Then I do a

while read <&6

Then it breaks down that data to stuff I need...a do case case scenario...
pretty much there data is 24/7/365 with stops for legit reasons... but its the
none legit data cessation ie: the remote connection got snafu'd what ever.. I
need to test for, and restart...or what not.

what I am not coming up with is a way to check if read didn't get any data in
say x seconds.. do something else.. like an alert or something...

This is done in BASH... right now since this is complete other than this little
data check I don't want to rewrite it in somthing else... I played with doing
some work with it in Python 2.7.x but for right now I would like to stick to
BASH....

What numbingly simple thing am I missing here....

Thanks!


Rick


... Ding Dong the Witch is DEAD! I Made America Great Again! President Trump!
--- GoldED+/LNX 1.1.5-b20161221
* Origin: Vina's Talos Moon Base Alpha (1:135/377)

SOURCE: echomail via QWK@docsplace.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.