Is there a Java method (or a class) that offers the same functionality as that of C's select()? e.g. Wait for input from two or more input streams or sockets at the same time (in my case, an InputStream and a DatagramSocket), and as soon as there is an input from either the streams or sockets the program continues on to process the input. (Also a timer can be associated with the wait, so if the wait times out, I can choose to react to the timeout.) Thanks for the help.