| 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectspellcast.client.ClientConnectionHandler
public class ClientConnectionHandler
This class handles the socket functions for the client.
| Constructor Summary | |
|---|---|
ClientConnectionHandler(SpellcastView view,
                        VersionDetails programVersionDetails)
 | 
|
| Method Summary | |
|---|---|
 void | 
connect(java.lang.String serverAddressString,
        java.lang.String wizardName,
        java.lang.String gender)
Request connection to the specified address and port.  | 
 void | 
disconnect()
Request the network controller to disconnect from the existing connection.  | 
 void | 
join()
Waits for the socket handler thread to complete.  | 
 GameEvent | 
receive()
Removes the first event from the incoming event queue and returns it.  | 
 void | 
run()
 | 
 void | 
send(GameEvent event)
Send the event to the server.  | 
| Methods inherited from class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
public ClientConnectionHandler(SpellcastView view,
                               VersionDetails programVersionDetails)
| Method Detail | 
|---|
public void run()
run in interface java.lang.Runnablepublic GameEvent receive()
wait
 until one is added when the server sends the client an event, at which point 
 the thread will be notified.
  
 If there is an IOException cleanup may call notify in which 
 case the event will be null.
public void send(GameEvent event)
public void connect(java.lang.String serverAddressString,
                    java.lang.String wizardName,
                    java.lang.String gender)
serverAddressString - a server string of the form host[:port]wizardName - the name of the client's wizardgender - the gender of the client's wizardpublic void disconnect()
public void join()
  | 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||