Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Asynchronous programming in Java?

807597Nov 10 2005 — edited Nov 10 2005
I 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.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 8 2005
Added on Nov 10 2005
6 comments
221 views