Click to See Complete Forum and Search --> : Simple problem I think


Bunty Ranu
June 6th, 2010, 10:03 PM
Solved

ProgramThis
June 7th, 2010, 08:15 AM
Besides the fact that main is throwing exceptions instead of just placing the code inside of the try/catch block that you already have, it's not bad. Yeah, you have it: that is the basics of socket connections. Create an input stream, an output stream and go. I personally use the ObjectOutputStream and ObjectInputStream when I do socket implementations, but that's just me.

Have you tried to run it? What do you get?

Bunty Ranu
June 7th, 2010, 09:14 AM
When I run it nothing happens, so I'm confused... not sure what the problem could be. >.<

I'm suppose to get a String returned from the server, not sure if it is a coding error on my end, or if the Server isn't sending it to me. When I send the new line character, I should be replied with the current time. What do you suggest?

keang
June 7th, 2010, 10:05 AM
Try reading the input stream until the end of stream is reached. When I ran your code the input stream contained a blank line before the data line.

Bunty Ranu
June 7th, 2010, 11:29 AM
Try reading the input stream until the end of stream is reached. When I ran your code the input stream contained a blank line before the data line.

Once again Keang you've helped me. You catch these little things really well. Thank you so much Keang!

keang
June 7th, 2010, 11:49 AM
You catch these little things really well. When you've made as many mistakes as I have you get good at correcting them. :)

Thank you so much KeangMy pleasure.

ajhampson
June 7th, 2010, 02:21 PM
When you've made as many mistakes as I have you get good at correcting them. :)

My pleasure.

Isn't that the truth; I right there with you!