this will trace only connections in the SYN_SENT status ... if you get a SocketTimeoutException, the connection will never transition in the ESTABLISHED state, it will only wait in the SYS_SENT state until it times out...
Maybe running netstat 10 times a second will kill your server, so you better sleep a bit more
cat monitornet.sh
while true
do
lines=`netstat -an | grep YOURDESTINATIONIP | grep SYN`
sleep 0.1
if [ "$lines" ]; then
echo `date` $lines
echo ""
fi
done
Maybe running netstat 10 times a second will kill your server, so you better sleep a bit more