nonblocking IO with select