Asynchronous programming in Java?
807597Nov 10 2005 — edited Nov 10 2005I am a C++ programmer, I just wonder how do I do asynchronous programming in Java?
In VC++, you can hook an event handler to the socket and the system will fire an event whenever there is data coming in to the socket. The event handler can then spawn a thread and handle the network message.
In Unix, you can use the select() function. This function will return whenever the indicated socket fires events. If nothing happens within the timeout period, the function simply returns.
What about in Java? I don't see any methods that allows you to hook an event handler to it. Is there anything like select() function in Unix?
Thanks so much.