|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
vooga.network.VoogaServer
public abstract class VoogaServer
VoogaServer maintains map of all open sockets and maintains set of connected users.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
static java.lang.String |
SERVER
|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
VoogaServer(int port)
Creates a server that listens for client connections on the given port. |
Method Summary | |
---|---|
protected java.util.Set<java.lang.String> |
getAllConnectedUsers()
|
java.io.ObjectInputStream |
getInStream(java.lang.String userName)
Gets the input stream that receives data from the named client. |
java.net.ServerSocket |
getMySocket()
Allows subclasses to reference their socket. |
java.io.ObjectOutputStream |
getOutStream(java.lang.String userName)
Gets the output stream that will send data to the named client. |
protected abstract void |
initialize()
Allows subclasses to perform an additional initialization after the server has been constructed and started listening. |
protected abstract void |
intializeConnection(java.lang.String clientName,
java.net.Socket clientSocket)
Allows server subclasses to implement additional initialization for a user connection, such as starting a server thread to receive input from that client. |
boolean |
listeningToSocket(java.lang.String userName)
Checks whether or not the server is currently listening to a connection from a client with the given userName. |
void |
removeConnection(java.lang.String userName)
|
void |
run()
|
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, 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 |
---|
public static final java.lang.String SERVER
Constructor Detail |
---|
public VoogaServer(int port) throws java.io.IOException
port
-
java.io.IOException
Method Detail |
---|
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
protected abstract void initialize()
protected abstract void intializeConnection(java.lang.String clientName, java.net.Socket clientSocket)
public java.net.ServerSocket getMySocket()
public java.io.ObjectInputStream getInStream(java.lang.String userName)
userName
-
public java.io.ObjectOutputStream getOutStream(java.lang.String userName)
userName
-
public boolean listeningToSocket(java.lang.String userName)
userName
-
protected java.util.Set<java.lang.String> getAllConnectedUsers()
public void removeConnection(java.lang.String userName)
userName
- to be removed from a connection
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |