public class EchoServer extends NetworkServer
Daemon.WithoutChdirarguments| Constructor and Description |
|---|
EchoServer(java.lang.String[] args) |
| Modifier and Type | Method and Description |
|---|---|
protected java.net.ServerSocket |
createServerSocket()
Creates a bound
ServerSocket that will be shared by all worker processes. |
protected void |
forkWorkers(JavaVMArguments args)
Forks the worker thread with the given JVM args.
|
protected void |
frontend()
Front-end.
|
static void |
main(java.lang.String[] args) |
protected boolean |
shouldBeDaemonized()
Daemonize if something is given as arguments.
|
protected void |
worker(java.net.ServerSocket ss)
Worker thread main code.
|
forkWorkerThreads, run, workerall, chdirToRoot, closeDescriptors, daemonize, daemonize, getCurrentExecutable, init, init, isDaemonized, selfExec, writePidFilepublic static void main(java.lang.String[] args)
throws java.lang.Exception
java.lang.Exceptionprotected boolean shouldBeDaemonized()
shouldBeDaemonized in class NetworkServerprotected void frontend()
throws java.lang.Exception
NetworkServerfrontend in class NetworkServerjava.lang.Exceptionprotected void forkWorkers(JavaVMArguments args) throws java.lang.Exception
NetworkServerNetworkServer.forkWorkerThreads(JavaVMArguments, int).forkWorkers in class NetworkServerjava.lang.Exceptionprotected java.net.ServerSocket createServerSocket()
throws java.lang.Exception
NetworkServerServerSocket that will be shared by all worker processes.
This method is called in the frontend process.createServerSocket in class NetworkServerjava.lang.Exceptionprotected void worker(java.net.ServerSocket ss)
throws java.lang.Exception
NetworkServerworker in class NetworkServerss - The server socket that the frontend process created.java.lang.ExceptionCopyright © 2012. All Rights Reserved.