|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.lang.Thread
ServerThread
This class handles ServerThread startup, operations and shutdown. Once a ServerThread is created, communications between client can occur. The ServerThread is passed information from the Server to communicate to the newly connected client.
Client,
Server| Field Summary |
| Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
ServerThread(java.net.Socket clientSocket,
ServerThread[] st,
java.lang.String dictionary,
int hints,
int id,
java.lang.String[] cNames)
Creates a new ServerThread |
|
| Method Summary | |
void |
close()
Closes the ServerThread |
void |
echo(java.lang.String inputLine)
Sends the inputLine to all clients. |
Scrabble |
getScrabble()
Gets Scrabble instance. |
void |
kick()
Echoes a kick request from the server lobby. |
void |
run()
|
void |
sendDictionary(java.lang.String file)
Streams a dictionary to the client, so that the client may receive the dictionary that the server wishes to use. |
| Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public ServerThread(java.net.Socket clientSocket,
ServerThread[] st,
java.lang.String dictionary,
int hints,
int id,
java.lang.String[] cNames)
clientSocket - The socket with which to connect.st - The ServerThread itself.dictionary - The dictionary to be used in the game.hints - The number of hints to be allowed in the game.id - The uid of the client.cNames - A list of current clients in the game.| Method Detail |
public Scrabble getScrabble()
public void run()
public void echo(java.lang.String inputLine)
inputLine - The String to echo to all clients.public void kick()
public void close()
public void sendDictionary(java.lang.String file)
file - The dictionary to send.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||