net.sf.sdedit.server
Class DiagramServer
java.lang.Object
java.lang.Thread
net.sf.sdedit.server.DiagramServer
- All Implemented Interfaces:
- Runnable
public class DiagramServer
- extends Thread
This class implements a simple server that uses a TCP socket to receive a
diagram source text and to send an image of the resulting diagram.
The exchange must follow this simple protocol:
- The client sends the mimetype of the image he would like to receive.
- The client sends the diagram source text.
- The client sends 'END'
-
- If the diagram cannot be created due to an error, the server sends a
message starting with 'ERROR:' and ending with a description of the error.
- Otherwise the server sends the image data.
There are currently two mime-types supported:
- image/png
- image/svg+xml (requires the SVG plugin)
- Author:
- Markus Strauch
|
Constructor Summary |
DiagramServer(int port)
Creates and starts a new DiagramServer listening at the given port. |
|
Method Summary |
void |
run()
Blocks until a connection is made, then creates a socket for the
connection and blocks again, waiting for the next connection. |
| Methods inherited from class java.lang.Thread |
activeCount, checkAccess, clone, 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 |
DiagramServer
public DiagramServer(int port)
throws IOException
- Creates and starts a new DiagramServer listening at the given port.
- Parameters:
port - the TCP port where the diagram server listens
- Throws:
IOException - if no DiagramServer listening at that port could be created
run
public void run()
- Blocks until a connection is made, then creates a socket for the
connection and blocks again, waiting for the next connection.
- Specified by:
run in interface Runnable- Overrides:
run in class Thread
Copyright © 2011. All Rights Reserved.