Results 1 to 3 of 3
- 04-26-2012, 03:34 AM #1
Senior Member
- Join Date
- Feb 2012
- Posts
- 219
- Rep Power
- 2
Chat Server won't print out what it's supposed to with certain input.
Sorry for the bad wording, but I had no idea how to word it. Basically, I followed the java tutorial on networking and made my own customized chat server. The problem seems to be simple in its solution, but I cannot seem to get it to work. I have a portion of the code that loops through the input, and as long as it does not equal "Quit" or null, it continues the loop and prints out what was sent to the server.
My problem is that it seems to be ignoring it. I type in Quit or list and it doesn't do what I want it to do. Any help is appreciated. Thanks!Java Code:while((inputLine = in.readLine()) != null) { out.println(inputLine); if(inputLine.equalsIgnoreCase("Quit")) break; if(inputLine.equalsIgnoreCase("list")) out.println("Number of people in the server: " + numPeople); }
- 04-26-2012, 05:21 PM #2
Member
- Join Date
- Apr 2012
- Posts
- 59
- Rep Power
- 0
Re: Chat Server won't print out what it's supposed to with certain input.
What does it do instead?
- 04-26-2012, 08:05 PM #3
Senior Member
- Join Date
- Feb 2012
- Posts
- 219
- Rep Power
- 2
Similar Threads
-
Help Needed! Android chat - pc chat server
By thornt in forum AndroidReplies: 3Last Post: 04-13-2012, 12:50 PM -
Help with Printing Array... Im supposed to print out so 9 elements show per line.
By s_mxyzptlk in forum New To JavaReplies: 3Last Post: 03-08-2012, 01:09 AM -
Chat Server
By mrbrendano in forum New To JavaReplies: 1Last Post: 09-19-2011, 11:08 PM -
midlet chat server
By nfitte in forum NetworkingReplies: 0Last Post: 07-09-2009, 09:08 AM -
simple chat server
By sari in forum New To JavaReplies: 0Last Post: 02-06-2009, 02:30 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks