I'd like to open a simple file socket that can run in background like:
nc -l -k -m 10 -U my_socket -c cat &
so other processes can connect into it with
nc -U my_socket -c read.
After this happen I want to count how many clients are currently connected to the socket, but at first I would like to ensure it is already opened before I start checking anything. I believe that
coproc can be used properly for this purpose, unfortunately I have got no idea how to use it.
Could I get any tips how to solve this one?