|
-
June 6th, 2010, 10:03 PM
#1
Simple problem I think
Last edited by Bunty Ranu; October 8th, 2010 at 10:31 AM.
-
June 7th, 2010, 08:15 AM
#2
Re: Simple problem I think
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?
-
June 7th, 2010, 09:14 AM
#3
Re: Simple problem I think
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?
-
June 7th, 2010, 10:05 AM
#4
Re: Simple problem I think
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.
-
June 7th, 2010, 11:29 AM
#5
Re: Simple problem I think
 Originally Posted by keang
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!
-
June 7th, 2010, 11:49 AM
#6
Re: Simple problem I think
You catch these little things really well.
When you've made as many mistakes as I have you get good at correcting them. 
My pleasure.
-
June 7th, 2010, 02:21 PM
#7
Re: Simple problem I think
 Originally Posted by keang
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!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|