|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Thread Facemorph.Server
public class Server
The Server class should run on the server in order to allow images to be saved to the server's disk and sent back to the client as a jpeg. Previously also used for saving Templates and as a HitCounter, not generally needed anymore.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
protected java.util.Vector |
connections
The list of connections |
protected int |
count
The number of connections to cycle around |
static int |
DEFAULT_PORT
The default port |
static int |
HIT_COUNTER
Specifies that you want to find or increment the HitCount. |
protected java.net.ServerSocket |
listen_socket
The Scocket to listen with |
static int |
OUTPUT_IMAGE
Specifies that you want to send an image to the Server for saving |
static int |
OUTPUT_TEMPLATE
Specifies that you want to send a Template to the Server for saving |
protected int |
port
The port that you are listening on |
protected Facemorph.Vulture |
vulture
The vulture to clean up dead connections |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
Server(int port,
java.lang.String directory,
java.lang.String outputDirURL)
Create a ServerSocket to listen for connections and start the thread |
Method Summary | |
---|---|
static void |
fail(java.lang.Exception e,
java.lang.String msg)
Exit with an error message when an exception occurs |
static void |
main(java.lang.String[] args)
Start the server up, listening on an optionally specified port |
void |
run()
The body of the server thread. |
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 int DEFAULT_PORT
public static final int OUTPUT_IMAGE
public static final int OUTPUT_TEMPLATE
public static final int HIT_COUNTER
protected int port
protected int count
protected java.net.ServerSocket listen_socket
protected final java.util.Vector connections
protected Facemorph.Vulture vulture
Constructor Detail |
---|
public Server(int port, java.lang.String directory, java.lang.String outputDirURL)
port
- The port to listen ondirectory
- The directory to save output tooutputDirURL
- Method Detail |
---|
public static void fail(java.lang.Exception e, java.lang.String msg)
e
- The Exception that caused the failuremsg
- The error messagepublic void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public static void main(java.lang.String[] args)
args
- The command line parameters.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |