using select to implement socket multiplexing, and non-blocking, asynchronous IO