|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.util.Observable
FileServer
This class starts the server and wait for connection
| Constructor Summary | |
FileServer()
|
|
| Method Summary | |
boolean |
Alive()
Check the liveness of Thread all file thread and return status |
String |
getIP()
find and return Local IP address of connected server socket return IP Address |
int |
getPort()
find and return Local port number of connected server socket return port number |
String |
getStatus()
Find and return thread status message |
void |
run()
Thread run method |
void |
setObserver(View v)
Set the Observer for Observable |
protected void |
startServer(int port)
Start file server and thread for accepting connection |
protected void |
stopServer()
stop server by closing socket and stopping thread |
| 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 FileServer()
| Method Detail |
public boolean Alive()
Alive in interface Actionspublic String getIP()
getIP in interface Actionspublic int getPort()
getPort in interface Actionspublic String getStatus()
getStatus in interface Actionspublic void run()
run in interface Runnablepublic void setObserver(View v)
setObserver in interface Actionsv - Observer Object
protected void startServer(int port)
throws Exception
port - port number
throws Exception If socket creation unsuccessful
Exceptionprotected void stopServer()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||