Is it possible to listen to a port continuously?
I listen for incoming tcp notifications with following command
sudo nc -l -p 999
But as soon as notification arrives I have to restart listen with same command. Is it possible to listen to port without having to restart command when notifications arrives until user decides to abort listen?
Sorta outdated question, but came up first on my Google search.
In order for netcat not to shutdown as soon as the first connection is received, you can add the -k
option.
From the man:
-k Forces nc to stay listening for another connection after its current connection is completed. It is an error to use this option without the -l option.