using select, to make it a nonblocking thing.