Forums Register Login

Client to Server Communication for Herbert Schildt

+Pie Number of slices to send: Send
Hi Herbert,

Thank you for writing The Complete Reference: Java 2 Fifth Edition. I used it in the instruction of my Java Class, and I cannot express my appreciation for how smooth the class went with the easy to follow examples and explanation presented in the book. Will there be a sixth edition convering Java 2 Version 1.5?

On a another note, I have been reviewing the Scrabblet practical application that you provided at the end of the book. I have a question on the communication sent between the Client and the Server. How's the following event triggered when the Server sends a message to the client?

class ServerConnection implements Runnable {
....
public void run() {
String s;
StringTokenizer st;
while ((s = readline()) != null) {
st = new StringTokenizer(s);
String keyword = st.nextToken();
switch (lookup(keyword)) {
default:
System.out.println("bogus keyword: " + keyword + "\r");
break;
....
case CHALLENGE: {
String from = st.nextToken();
scrabblet.challenge(from);
}
break;
}
}
}
}

Your response will be much appreciated.

Thank you.
The fastest and most reliable components of any system are those that are not there. Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 670 times.
Similar Threads
about StringTokenize===>
Reversing a string
StringBuffer Very Urgent please
Parsing of StringBuffer(URGENT)
java client/ c server problem
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 15, 2024 22:48:39.