public class RemoteControlHttpServer extends java.lang.Thread
RequestProcessor
for every
connection.
Taken from YWMS plugin by frsantos.Modifier and Type | Field and Description |
---|---|
private static RemoteControlHttpServer |
instance4
The server instance for IPv4
|
private static RemoteControlHttpServer |
instance6
The server instance for IPv6
|
private java.net.ServerSocket |
server
The server socket
|
Constructor and Description |
---|
RemoteControlHttpServer(int port,
boolean ipv6)
Constructor
|
Modifier and Type | Method and Description |
---|---|
static void |
restartRemoteControlHttpServer()
Starts or restarts the HTTP server
|
void |
run()
The main loop, spawns a
RequestProcessor for each connection |
static void |
stopRemoteControlHttpServer()
Stops the HTTP server
|
void |
stopServer()
Stops the HTTP server
|
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
private final java.net.ServerSocket server
private static volatile RemoteControlHttpServer instance4
private static volatile RemoteControlHttpServer instance6
public RemoteControlHttpServer(int port, boolean ipv6) throws java.io.IOException
port
- The port this server will listen onipv6
- Whether IPv6 or IPv4 server should be startedjava.io.IOException
- when connection errorspublic static void restartRemoteControlHttpServer()
public static void stopRemoteControlHttpServer()
public void run()
RequestProcessor
for each connectionrun
in interface java.lang.Runnable
run
in class java.lang.Thread
public void stopServer() throws java.io.IOException
java.io.IOException
- if any I/O error occurs