|
JSettlers v1.0.6 API Built ${date} |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
soc.server.genericServer.Server
a general purpose server
Field Summary | |
protected java.util.Vector |
conns
the connections |
protected java.lang.Exception |
error
|
java.util.Vector |
inQueue
|
protected int |
numberOfConnections
total number of connections made |
protected int |
port
|
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
Server(int port)
start listening to the given port |
Method Summary | |
protected void |
addConnection(Connection c)
add a connection to the system |
protected void |
broadcast(java.lang.String m)
broadcast a message |
protected int |
connectionCount()
|
protected java.util.Enumeration |
getConnections()
|
protected boolean |
isUp()
|
protected void |
leaveConnection(Connection c)
placeholder for doing things when a connection is closed |
protected void |
newConnection(Connection c)
placeholder for doing things when a new connection comes |
abstract void |
processCommand(java.lang.String str,
Connection con)
DOCUMENT ME! |
protected void |
removeConnection(Connection c)
remove a connection from the system |
protected void |
removeConnectionCleanup(Connection c)
do cleanup after a remove connection |
void |
run()
run method for Server |
protected void |
serverDown()
placeholder for doing things when server gets down |
void |
stopServer()
The server is being stopped, disconnect all the connections. |
void |
treat(java.lang.String s,
Connection c)
treat a request from the given connection |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.lang.Exception error
protected int port
protected int numberOfConnections
protected java.util.Vector conns
public java.util.Vector inQueue
Constructor Detail |
public Server(int port)
Method Detail |
protected java.util.Enumeration getConnections()
protected int connectionCount()
protected boolean isUp()
public void run()
run
in interface java.lang.Runnable
public void treat(java.lang.String s, Connection c)
public abstract void processCommand(java.lang.String str, Connection con)
str
- DOCUMENT ME!con
- DOCUMENT ME!protected void serverDown()
protected void newConnection(Connection c)
protected void leaveConnection(Connection c)
public void stopServer()
protected void removeConnection(Connection c)
protected void removeConnectionCleanup(Connection c)
protected void addConnection(Connection c)
protected void broadcast(java.lang.String m)
|
JSettlers v1.0.6 API Built ${date} |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |