|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Observable
ClientNetwork
public class ClientNetwork
This is the network connection between server and the client It manages all outgoing and incoming messages to and from the server
Constructor Summary | |
---|---|
ClientNetwork(java.lang.String ip,
java.lang.String port)
Creates new connection with the server |
Method Summary | |
---|---|
boolean |
checkConnection()
Check whether connection has been established with the server |
java.lang.String |
getMsg()
Returns the message received from the server |
void |
run()
Start the network connection |
void |
sendMsg(java.lang.String msg)
Send message to server |
Methods inherited from class java.util.Observable |
---|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ClientNetwork(java.lang.String ip, java.lang.String port)
ip
- The ip address of the serverport
- The port number of the serverMethod Detail |
---|
public void run()
run
in interface java.lang.Runnable
public java.lang.String getMsg()
public void sendMsg(java.lang.String msg)
msg
- Message to send to the serverpublic boolean checkConnection()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |