Running 2 threads simultaneously

Posted by lamsaitat on Stack Overflow See other posts from Stack Overflow or by lamsaitat
Published on 2009-04-20T16:13:40Z Indexed on 2010/05/02 9:17 UTC
Read the original article Hit count: 143

In the case of an IM client. I have made 2 separate threads to handle sending packets (by std io) and receiving packets. The question is how to make these 2 threads run simultaneously so that I can keep prompting for input while at the same time be ready to receive packets at any time?

I have already tried setting a timer but the data is always lost receiving.

© Stack Overflow or respective owner

Related posts about java

Related posts about network-programming