I'm trying to make a simple instant messenger in java to practice with packets. I've made a messenger client that can send messages but I'm having trouble receiving them. I've got a "server" program that displays messages I send it but now I got to go to the next step and display messages inside the messenger. The problem is, I can't create a loop to check is the BufferedReader has information in the next line like in my server program because It would be frozen; waiting for packets. So I need to somehow be able to spring an event once I receive a packet message. I've been trying to google this but I'm not sure if BufferedReader events exist. If one doesn't, can someone recommend how I can go about doing this?
while((inputLine = in.readLine()) != null)
can you please post your client and server code? thanks
Seeing the code is not necessary for answering the question.... :eek: