public class EchoServer extends NetworkServer
Daemon.WithoutChdir
arguments
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, worker
all, chdirToRoot, closeDescriptors, daemonize, daemonize, getCurrentExecutable, init, init, isDaemonized, selfExec, writePidFile
public EchoServer(String[] args)
protected boolean shouldBeDaemonized()
shouldBeDaemonized
in class NetworkServer
protected void frontend() throws Exception
NetworkServer
frontend
in class NetworkServer
Exception
protected void forkWorkers(JavaVMArguments args) throws Exception
NetworkServer
NetworkServer.forkWorkerThreads(JavaVMArguments, int)
.forkWorkers
in class NetworkServer
Exception
protected ServerSocket createServerSocket() throws Exception
NetworkServer
ServerSocket
that will be shared by all worker processes.
This method is called in the frontend process.createServerSocket
in class NetworkServer
Exception
protected void worker(ServerSocket ss) throws Exception
NetworkServer
worker
in class NetworkServer
ss
- The server socket that the frontend process created.Exception
Copyright © 2015. All rights reserved.