io multiplexing 2 with shutdown for EOF from stdin