Stdin & socket dual-listening