Results 1 to 6 of 6
  1. #1
    Ben255 is offline Member
    Join Date
    Sep 2013
    Posts
    3
    Rep Power
    0

    Default ObjectInputStream

    So ive made a chat program of some kind with server and klients.
    i can write to the server and all.
    Dont know what to do with the inputstream like i tried to update the chatwindow with a timer every so many seconds but that just puts the inputstream in some wierd loop and the gui freezes.
    like how will the server notify the klient over the socket that it needs to read at that moment?
    Thanks

  2. #2
    Ben255 is offline Member
    Join Date
    Sep 2013
    Posts
    3
    Rep Power
    0

    Default Re: ObjectInputStream

    Think this might work for those that are intrested, anyway got a new project :p.

    Port port = null;
    port.addLineListener(new LineListener(){
    public void update(LineEvent arg0) {
    }
    });

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,189
    Rep Power
    19

    Default Re: ObjectInputStream

    Quote Originally Posted by Ben255 View Post
    Think this might work ...

    Port port = null;
    port.addLineListener(...
    Sure formula for a NullPointerException.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  4. #4
    Ben255 is offline Member
    Join Date
    Sep 2013
    Posts
    3
    Rep Power
    0

    Default Re: ObjectInputStream

    Quote Originally Posted by DarrylBurke View Post
    Sure formula for a NullPointerException.

    db
    ...........................
    Last edited by doWhile; 09-04-2013 at 10:02 PM. Reason: Removed profanity & personal attack

  5. #5
    gimbal2 is online now Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,083
    Rep Power
    4

    Default Re: ObjectInputStream

    I see in your near future that you are going to be banned - I have that epic brain power.

    Before you do get banned: the code you posted produces an NPE without any chance if it not happening because you don't initialize the port variable, smarty pants. Why don't you try using your brain in stead of mashing on the dot button on your keyboard all the time?
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  6. #6
    ben256 is offline Banned
    Join Date
    Sep 2013
    Posts
    1
    Rep Power
    0

    Default Re: ObjectInputStream

    Quote Originally Posted by gimbal2 View Post
    I see in your near future that you are going to be banned - I have that epic brain power.

    Before you do get banned: the code you posted produces an NPE without any chance if it not happening because you don't initialize the port variable, smarty pants. Why don't you try using your brain in stead of mashing on the dot button on your keyboard all the time?
    in theory it would work ffs dude, if you would initialize the port and all that, what i wrote was just an example. but nvm not comming back here again... since you guys are to mature for me.
    ps. you can remove this account to

Similar Threads

  1. ObjectInputStream not the same as ObjectOutputStream
    By L19htn1n9 in forum Advanced Java
    Replies: 9
    Last Post: 06-27-2012, 06:36 PM
  2. ClassNotFoundException with ObjectInputStream
    By AtlDynasty25 in forum Android
    Replies: 2
    Last Post: 04-22-2012, 07:08 PM
  3. ObjectInputStream issue
    By aianta in forum New To Java
    Replies: 8
    Last Post: 04-13-2011, 01:22 AM
  4. ObjectInputStream does not initialize
    By Singing Boyo in forum New To Java
    Replies: 1
    Last Post: 06-03-2009, 08:11 AM
  5. Reading from ObjectInputStream
    By deepthought015 in forum Networking
    Replies: 8
    Last Post: 04-28-2009, 05: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
  •