use a netcat server rather than a sleep for the bash example