public class EchoServer extends NetworkServer
Daemon.WithoutChdirarguments| Constructor and Description |
|---|
EchoServer(String[] args) |
| Modifier and Type | Method and Description |
|---|---|
protected 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(String[] args) |
protected boolean |
shouldBeDaemonized()
Daemonize if something is given as arguments.
|
protected void |
worker(ServerSocket ss)
Worker thread main code.
|
forkWorkerThreads, run, workerall, chdirToRoot, closeDescriptors, daemonize, daemonize, getCurrentExecutable, init, init, isDaemonized, selfExec, writePidFilepublic EchoServer(String[] args)
protected boolean shouldBeDaemonized()
shouldBeDaemonized in class NetworkServerprotected void frontend()
throws Exception
NetworkServerfrontend in class NetworkServerExceptionprotected void forkWorkers(JavaVMArguments args) throws Exception
NetworkServerNetworkServer.forkWorkerThreads(JavaVMArguments, int).forkWorkers in class NetworkServerExceptionprotected ServerSocket createServerSocket() throws Exception
NetworkServerServerSocket that will be shared by all worker processes.
This method is called in the frontend process.createServerSocket in class NetworkServerExceptionprotected void worker(ServerSocket ss) throws Exception
NetworkServerworker in class NetworkServerss - The server socket that the frontend process created.ExceptionCopyright © 2015. All rights reserved.