@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2 3 4



Comments:

<0> hello ... i have a question about p***ing objects using sockets
<1> I have an answer about p***ing objects using sockets. want to trade?
<0> heeeheee
<0> no really
<0> what i am trying to do is build a simple client that establishes a connection a a simple server and p***es one object and the server just print that object out
<0> that is all
<1> how far did you get?
<0> very far but i think i have problem in understanding how the object is p***ed
<0> i compiled both codes
<0> the client and the server
<0> but i am getting an error running the client
<0> i think i am not p***ing the object the right way
<1> which error would that be?
<0> wanna see my code?
<0> probably i am doing something wrong
<1> I guess. stick it on rafb.net/paste or something



<0> Exception in thread "main" java.lang.NullPointerException
<0> at Client.Send(Client.java:44)
<0> at Client.<init>(Client.java:20)
<0> at Client.main(Client.java:60)
<1> what is Client.java line 44?
<0> i posted the code
<0> line 44 is
<0> outputStreamToServer.writeObject(x);
<1> paste the urls from the pastebins here
<0> ok
<0> http://rafb.net/p/hDRgan91.html
<1> you never instantiate outputStreamToServer
<1> do something like outputStreamToServer=new ObjectOutputStream(socket.getOutputStream());
<0> i did
<0> see the code
<1> I can't see it there, which line?
<0> oppps
<0> you are rightr
<0> let me add it
<0> and see
<0> i will let you know
<0> ok the Client worked but when it sent the object
<0> an error happened in the server
<1> is it the same kind of error?
<0> not exactly
<0> here it is and i am going to post my server code too
<0> Exception in thread "main" java.lang.Cl***CastException: chatMsg cannot be cast
<0> to java.lang.String
<0> at Server.listen(Server.java:44)
<0> at Server.<init>(Server.java:15)
<0> at Server.main(Server.java:63)
<0> here is the code
<0> http://rafb.net/p/2v4RCK75.html
<1> is a String you want to read?
<1> or is it a chatMsg
<0> what i am really interested is am i p***ing the object chatMsg correctly
<0> i want to read the object x which is from the type chatMsg back in the server
<1> now you're trying t read the object x which is of the type String
<1> thus the String aLine = (String) blah part
<0> no it is a type that i created
<0> it is an instant of the cl*** chatMsg
<0> which is in a seprate file
<1> look at line 43 and 44. does it say chatMsg anywhere?
<0> ok
<0> i will look
<1> just replacing "String" with "chatMsg" should fix most it
<0> so if i define aLine as chatMsg that would work?
<0> nice
<0> i will try
<0> and will let you know
<1> you'll probably want to print something like aLine.getChatText() or whatever instead of aLine itself too
<1> unless chatMsg has a toString method
<0> wow
<0> **** that worked
<0> thannnnks
<1> weee
<0> how can i
<0> treat you
<1> dance for me
<0> i mean i really would love to treat you some how
<0> heeeheeee



<0> man you are helpfull
<1> and make it slow
<0> heeeeheee
<0> but i am a man
<0> unless if that does not matter to you
<0> lol
<1> slap on some lipstick and it'll be fine
<0> anyways man thank you ... you know it is just i was not sure i was doing the p***ing right
<1> np
<0> i though i was not understanding the concept right
<2> hey
<2> I'm having a wierd problem in JDEV, I'm using learningIO...
<2> It won't read inside of an if in a while.
<2> while (stuff) { if (stuff) { variable = LearningIO.readChar(); } }
<2> when i debugg i get (out of scope)
<2> what does that mean?
<2> it just skips right past asking for it, and goes back to the beginning of the while
<1> well, LearningIO is not a standard cl*** so you'd have to link to it
<2> um... no but i might be able to find one
<2> er
<2> wait what?
<2> sorry i misread that
<2> link to it how?
<1> a http link to the .jar/.cl***/.java
<1> plus perhaps your own code
<2> ...
<2> it already works.
<2> I can use it outside of the if
<2> but once I'm in the if it doesn't work.
<1> if I had the cl*** I could test it
<1> maybe it's just something with your code that's not LearningIO related. try posting it on rafb.net/paste (and paste the link here)
<2> http://rafb.net/p/HLA62c60.html
<2> you can take the comment//'s out before the println
<2> doesn't make a difference
<2> anything look wrong?
<1> Darkkish: the problem is that the readChar() in the if-statement reads the Enter you pressed after inputting 'a'
<2> hmm
<2> how would i fix that?
<1> you can do char myChar=moo.readLine().charAt(0); instead
<1> to read an entire line and then use the first char
<2> lol well you're positive it wouldn't just read the enter as the line?
<1> I mean you'd do that every place you want to read a single char
<2> I got some kind of exception
<2> java.lang.StringIndexOutOfBound***ception: String index out of range: 0
<1> remember to replace line 14 too
<2> oh
<2> awesome
<2> thanks
<2> so why is readChar doing that by its self?
<1> if you press "a\n" then readChar will read 'a' and '\n'
<2> well thats lame...
<2> oh well, thanks.
<2> koala_man do you know mIRC script?
<1> nope
<2> in mIRC you can go: if ("rawr" isin string) { }
<2> isin means it will search the string for the text rawr
<2> is there a way to do that in java?
<2> some method?
<1> if(myString.indexOf("rawr") != -1)
<1> or if(myString.matches(".*rawr.*"))
<2> what is myString?
<2> oh wait nvm
<2> lol
<2> thanks
<2> hmm
<2> how can i make an infinite loop?
<2> for (" ") { //right?
<1> while(true) ..
<2> oh thanks
<2> i like that better
<1> or for(;;)
<2> do you use for, or while more in java?
<1> dunno. for probably.
<2> oh


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #java
or
Go to some related logs:

#linux
#worldchat
yesim kis
#linux
#chat-world
#india
error C2664: 'FindWindowW'
#chat-world
#chat-world
#india



Home  |  disclaimer  |  contact  |  submit quotes