public class CheckersHost extends Host
| Constructor | Description |
|---|---|
CheckersHost(int port,
java.lang.String username) |
Create a host listening on the specified port, and start the message processing thread.
|
| Modifier and Type | Method | Description |
|---|---|---|
protected void |
clientConnected(int playerID) |
Called when a new player is connected.
|
protected void |
clientDisconnected(int playerID) |
Called when a player disconnects.
|
protected void |
messageReceived(int playerID,
java.lang.Object message) |
Responds when a message is received from a client.
|
extraHandshake, getAutoreset, getClientList, resetOutput, restartServer, sendToAll, sendToOne, setAutoreset, shudownHost, shutdownServerSocketpublic CheckersHost(int port,
java.lang.String username)
throws java.io.IOException
port - The port to listen onjava.io.IOException - if it is not possible to create a listening socket on the specified portprotected void messageReceived(int playerID,
java.lang.Object message)
messageReceived in class HostplayerID - message - The actual message that was sentprotected void clientConnected(int playerID)
clientConnected in class HostplayerID - The ID of the newly connected playerprotected void clientDisconnected(int playerID)
clientDisconnected in class HostplayerID - The ID of the disconnected player.