Results 1 to 3 of 3
  1. #1
    MrFish is offline Member
    Join Date
    Jan 2010
    Posts
    43
    Rep Power
    0

    Default BufferedReader Events?

    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?



    Server code:

    Java Code:
    while((inputLine = in.readLine()) != null)
    		{
    			System.out.println(inputLine);
    		}

  2. #2
    al_Marshy_1981 is offline Senior Member
    Join Date
    Feb 2010
    Location
    Waterford, Ireland
    Posts
    748
    Rep Power
    5

    Default

    can you please post your client and server code? thanks

  3. #3
    MrFish is offline Member
    Join Date
    Jan 2010
    Posts
    43
    Rep Power
    0

    Default

    Seeing the code is not necessary for answering the question.... :eek:

Similar Threads

  1. How to use BufferedReader?
    By ProgramBeginner in forum New To Java
    Replies: 4
    Last Post: 10-11-2011, 03:56 PM
  2. BufferedReader
    By Nerijus in forum New To Java
    Replies: 4
    Last Post: 04-26-2010, 08:28 PM
  3. typed events vs untyped events.
    By Drun in forum SWT / JFace
    Replies: 0
    Last Post: 11-23-2009, 01:22 PM
  4. BufferedReader, need help!
    By zacharyrod in forum New To Java
    Replies: 10
    Last Post: 11-19-2009, 11:56 AM
  5. BufferedReader
    By vidhya.sk in forum New To Java
    Replies: 2
    Last Post: 09-18-2008, 02:57 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •