Network checking while running a script

hi,

i am new to this scripting stuff so please help.
i need a script that should check network connection while process.bsh is running which connects to a server for some time (e.g. 30 secs to a minute) and I wanted to make sure that network interruption does not happen during this time period to prevent data loss.

How should my script look like?
Is there a way that i could do the network check while process.bsh is still running?

try this code

MACHINE=10.0.0.1 # Change to what ever you need
PORT=23 
exec 3>/dev/tcp/${MACHINE}/${PORT}
if [ $? -eq 0 ]
then
    echo "server accepting connections on $PORT port"
else
    echo "server connections not possible $PORT port"
fi

yes.
but i meant WHILE process.bsh executes?

process queries from 10.0.0.1,for example, returning results every min.
how do i detect interruptions during this minute and prompting that there had been such interruption?

or am i just over-thinking things?
:confused: