LectureGame.Core
Class MasterClient

java.lang.Object
  extended by LectureGame.Core.StudentClient
      extended by LectureGame.Core.MasterClient
All Implemented Interfaces:
java.lang.Runnable

public class MasterClient
extends StudentClient

The MasterClient class inherits from the StudentClient class, and is in that respect a special case of the studen client Differs from the StudentClient class in the way the class handles new conenctions and how it handles replies from the connected peer.

See Also:
MasterClient, NetworkConnectionKeeper, NetworkManager

Nested Class Summary
 
Nested classes/interfaces inherited from class LectureGame.Core.StudentClient
StudentClient.ConnectionState
 
Field Summary
private  NetworkManager manager
           
private  java.net.ServerSocket serverSocket
           
 
Fields inherited from class LectureGame.Core.StudentClient
clientIP, clientName, connectionstate, db, endPing, in, inBufferedReader, isConnected, lectureCode, lineOut, loggedIn, parent, password, pingCounter, pinglist, pinglistClient, pingSleep, server, startPing, username
 
Constructor Summary
MasterClient(NetworkConnectionKeeper n, NetworkManager manager)
           
 
Method Summary
(package private)  void close()
          Closes the connection and all streams which are open
private  void init()
           
private  void parse(java.lang.String received)
           
 void run()
           
 void setServerSocket(java.net.ServerSocket socketListener)
          Sets the serversocket to be used for listening for new incoming connections
 
Methods inherited from class LectureGame.Core.StudentClient
connectionWait, getAllowedToAnswer, getAnswer, getTimeStampLastReceivedData, getTotalScore, getUsername, inDataAvailiable, loginStatus, receive, sendData, sendQuestion, setAllowedToAnswer, stop, testTrouble, triggerPing, wakeme
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serverSocket

private java.net.ServerSocket serverSocket

manager

private NetworkManager manager
Constructor Detail

MasterClient

public MasterClient(NetworkConnectionKeeper n,
                    NetworkManager manager)
Method Detail

init

private void init()

parse

private void parse(java.lang.String received)

run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class StudentClient

close

void close()
Closes the connection and all streams which are open

Overrides:
close in class StudentClient

setServerSocket

public void setServerSocket(java.net.ServerSocket socketListener)
Sets the serversocket to be used for listening for new incoming connections

Parameters:
socketListener - a ServerSocket
See Also:
ServerSocket