pnuts.tools
Class PersonalServer
java.lang.Object
|
+--pnuts.tools.PersonalServer
- public class PersonalServer
- extends java.lang.Object
This program is a network server which receives scripts sent by
a local user program and executes the scripts.
When a ServerSocket is created, this program writes 10 bytes data including
local port number (2 bytes) and a random number (8 bytes), to file
${HOME}/.pnuts/cookie.
This server receives any Pnuts script after 9 bytes control data.
The first 8 bytes of the control data must be same as one generated when the
server started.
If the other 1 byte is non-zero, echo is enabled. In this case, Pnuts.load() method
is called twice. The first time is executed without echoes.
In a multi-user environment, directory "${HOME}/.pnuts" should not be
readable from other users.
Usage:
java PersonalServer [ -port NNNN ] [ -home PATH ]
Method Summary |
void |
handle()
|
static void |
main(java.lang.String[] args)
|
void |
start()
|
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
DEFAULT_PORT
public static final int DEFAULT_PORT
PersonalServer
public PersonalServer()
throws java.io.IOException
PersonalServer
public PersonalServer(int port,
java.lang.String home)
throws java.io.IOException
handle
public void handle()
start
public void start()
throws java.io.IOException
main
public static void main(java.lang.String[] args)
throws java.lang.Throwable