|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--gecco.communication.server.NewClientListener
A class that will listen for incoming connections from clients, and handle the initial communication, until the client successfully joins as a role, and calls startGame. all communication with the client will thereafter be handled by a DataExchangeHandler
| Field Summary | |
private DataInputStream |
data_in
Description of the Field |
private DataOutputStream |
data_out
Description of the Field |
private ServerSocket |
server
Description of the Field |
private ClientAmbassador |
started_by
Description of the Field |
| Constructor Summary | |
NewClientListener(ClientAmbassador s,
int port)
|
|
| Method Summary | |
Socket |
accept()
Description of the Method |
private boolean |
connectToKrigsspel(Socket s,
String role)
to be modified in iteration 2 |
void |
run()
to be removed in iteration 2 |
private void |
sendAvailableRoles(Socket s)
Description of the Method |
void |
sendMap()
sends the whole map |
void |
sendMapSize()
sends the size of the map |
private void |
startGame(Socket s,
String role)
Description of the Method |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
private DataInputStream data_in
private DataOutputStream data_out
private ClientAmbassador started_by
private ServerSocket server
| Constructor Detail |
public NewClientListener(ClientAmbassador s,
int port)
throws IOException
port - The port where to listen for incoming
connectionss - Description of ParameterIOException - Description of Exception| Method Detail |
public void run()
run in interface Runnablepublic Socket accept()
public void sendMapSize()
throws Exception
Exception - Description of Exception
public void sendMap()
throws Exception
Exception - Description of Exception
private void sendAvailableRoles(Socket s)
throws Exception
s - Description of ParameterException - Description of Exception
private boolean connectToKrigsspel(Socket s,
String role)
s - Description of Parameterrole - Description of Parameter
private void startGame(Socket s,
String role)
s - Description of Parameterrole - Description of Parameter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||