|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcore.ClientNetworkThread
public class ClientNetworkThread
This class runs as a separate Thread managing network data.
Field Summary | |
---|---|
protected BufferedReader |
is
|
protected LectureGame |
lega
|
protected Thread |
networkThread
|
protected PrintWriter |
os
|
protected int |
protocolState
|
String |
received
|
protected Socket |
socket
|
protected boolean |
stringBuffered
|
Constructor Summary | |
---|---|
ClientNetworkThread(LectureGame lega)
|
Method Summary | |
---|---|
void |
close()
Sends a request for close message to the server which initiatez closing of the connection. |
String |
receive()
Strips off protocol specific headers from the inputStream and returns the remaining String. |
void |
run()
initiates connection to the server and constantly listens for incomming data and routs them to appropriate methods for reception and parsing. |
void |
send(String str)
Sends the given String to the server. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected LectureGame lega
protected PrintWriter os
protected BufferedReader is
protected Socket socket
protected int protocolState
protected boolean stringBuffered
public String received
protected Thread networkThread
Constructor Detail |
---|
public ClientNetworkThread(LectureGame lega)
Method Detail |
---|
public void run()
run
in interface Runnable
public String receive()
public void close()
public void send(String str)
str
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |