Package com.sun.akuma
Class EchoServer
java.lang.Object
com.sun.akuma.Daemon
com.sun.akuma.NetworkServer
com.sun.akuma.EchoServer
Sample echo server.
- Author:
- Kohsuke Kawaguchi
-
Nested Class Summary
Nested classes/interfaces inherited from class com.sun.akuma.Daemon
Daemon.WithoutChdir -
Field Summary
Fields inherited from class com.sun.akuma.NetworkServer
arguments -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ServerSocketCreates a boundServerSocketthat will be shared by all worker processes.protected voidforkWorkers(JavaVMArguments args) Forks the worker thread with the given JVM args.protected voidfrontend()Front-end.static voidprotected booleanDaemonize if something is given as arguments.protected voidworker(ServerSocket ss) Worker thread main code.Methods inherited from class com.sun.akuma.NetworkServer
forkWorkerThreads, run, workerMethods inherited from class com.sun.akuma.Daemon
all, chdirToRoot, closeDescriptors, daemonize, daemonize, getCurrentExecutable, init, init, isDaemonized, selfExec, writePidFile
-
Constructor Details
-
EchoServer
-
-
Method Details
-
main
- Throws:
Exception
-
shouldBeDaemonized
protected boolean shouldBeDaemonized()Daemonize if something is given as arguments.- Overrides:
shouldBeDaemonizedin classNetworkServer
-
frontend
Description copied from class:NetworkServerFront-end.- Overrides:
frontendin classNetworkServer- Throws:
Exception
-
forkWorkers
Description copied from class:NetworkServerForks the worker thread with the given JVM args. The implementation is expected to modify the arguments to suit their need, then call intoNetworkServer.forkWorkerThreads(JavaVMArguments, int).- Specified by:
forkWorkersin classNetworkServer- Throws:
Exception
-
createServerSocket
Description copied from class:NetworkServerCreates a boundServerSocketthat will be shared by all worker processes. This method is called in the frontend process.- Specified by:
createServerSocketin classNetworkServer- Throws:
Exception
-
worker
Description copied from class:NetworkServerWorker thread main code.- Specified by:
workerin classNetworkServer- Parameters:
ss- The server socket that the frontend process created.- Throws:
Exception
-