|
9 | 9 | Run it as a regular `Java` CLI app: |
10 | 10 |
|
11 | 11 | ```bash |
12 | | -$> java -jar epmd-2.0.0.jar |
13 | | -2019-06-06 00:10:18.869 INFO : Starting server on port 4369 |
| 12 | +$> java -jar epmd-2.0.0.jar server |
| 13 | +2019-03-17 01:38:09.302 INFO : EPMD server started (debug: false, port: 4369, allowed-ips: [localhost/127.0.0.1], unsafe-commands: true) |
14 | 14 |
|
15 | 15 | ``` |
16 | 16 |
|
17 | 17 | To get names of all registered nodes: |
18 | 18 |
|
19 | 19 | ```bash |
20 | | -$> java -jar epmd-2.0.0.jar -names |
21 | | -popa |
22 | | -echo |
| 20 | +$> java -jar epmd-2.0.0.jar names |
| 21 | +2019-03-17 01:45:39.310 INFO : EPMD up and running on port 4369 with the registered node(s): |
| 22 | + - node 'echo' at port 60045 |
23 | 23 | ``` |
24 | 24 |
|
25 | 25 | To see another options and commands, just type: |
26 | 26 |
|
27 | 27 | ```bash |
28 | 28 | $> java -jar epmd-2.0.0.jar --help |
29 | | -usage: java -jar epmd.jar [-d|-debug] [DbgExtra...] [-address List] |
30 | | - [-port No] [-daemon] [-relaxed_command_check] |
31 | | - java -jar epmd.jar [-d|-debug] [-port No] [-names|-kill|-stop name] |
32 | | - |
33 | | -Regular options |
34 | | - -address List |
35 | | - Let epmd listen only on the comma-separated list of IP |
36 | | - addresses (and on the loopback interface). |
37 | | - -port No |
38 | | - Let epmd listen to another port than default 4369 |
39 | | - -d |
40 | | - -debug |
41 | | - Enable debugging. This will give a log to |
42 | | - the standard error stream. It will shorten |
43 | | - the number of saved used node names to 5. |
44 | | - |
45 | | - If you give more than one debug flag you may |
46 | | - get more debugging information. |
47 | | - -relaxed_command_check |
48 | | - Allow this instance of epmd to be killed with |
49 | | - epmd -kill even if there are registered nodes. |
50 | | - Also allows forced unregister (epmd -stop). |
51 | | - |
52 | | -DbgExtra options |
53 | | - -packet_timeout Seconds |
54 | | - Set the number of seconds a connection can be |
55 | | - inactive before epmd times out and closes the |
56 | | - connection (default 60). |
57 | | - |
58 | | - -delay_accept Seconds |
59 | | - To simulate a busy server you can insert a |
60 | | - delay between epmd gets notified about that |
61 | | - a new connection is requested and when the |
62 | | - connections gets accepted. |
63 | | - |
64 | | - -delay_write Seconds |
65 | | - Also a simulation of a busy server. Inserts |
66 | | - a delay before a reply is sent. |
67 | | - |
68 | | -Interactive options |
69 | | - -names |
70 | | - List names registered with the currently running epmd |
71 | | - -kill |
72 | | - Kill the currently running epmd |
73 | | - (only allowed if -names show empty database or |
74 | | - -relaxed_command_check was given when epmd was started). |
75 | | - -stop Name |
76 | | - Forcibly unregisters a name with epmd |
77 | | - (only allowed if -relaxed_command_check was given when |
78 | | - epmd was started). |
| 29 | +Usage: epmd [-dhV] [-p=PORT] [COMMAND] |
| 30 | + |
| 31 | +Erlang port mapper daemon. This is a small name server used by Erlang programs |
| 32 | +when establishing distributed Erlang communications. |
| 33 | + |
| 34 | +Options: |
| 35 | + -p, --port=PORT Let epmd listen to another port than default 4369. This can also |
| 36 | + be set using environment variable ERL_EPMD_PORT |
| 37 | + -d, --debug Enables debugging logs |
| 38 | + -h, --help Show this help message and exit. |
| 39 | + -V, --version Print version information and exit. |
| 40 | + |
| 41 | +Commands: |
| 42 | + help Displays help information about the specified command |
| 43 | + names Lists names registered with the currently running epmd. |
| 44 | + server Starts the epmd server. |
| 45 | + stop Forcibly unregisters a live node from the epmd database. |
| 46 | + kill Kills the currently running epmd. |
| 47 | + |
| 48 | +Run 'epmd help COMMAND' for more information on a command. |
79 | 49 |
|
80 | 50 | ``` |
81 | 51 |
|
@@ -104,12 +74,13 @@ compile 'io.appulse.epmd.java:server:2.0.0' |
104 | 74 | To start EPMD server in your code: |
105 | 75 |
|
106 | 76 | ```java |
| 77 | +import io.appulse.epmd.java.server.SubcommandServer; |
107 | 78 | // ... |
108 | | -CommonOptions commonOptions = new CommonOptions(); |
109 | | -commonOptions.setPort(4369); |
110 | | - |
111 | | -ServerCommandExecutor server = new ServerCommandExecutor(commonOptions, new ServerCommandOptions()); |
| 79 | +val server = SubcommandServer.builder() |
| 80 | + .port(6666) // if not set, default is 4369 |
| 81 | + .ip(SubcommandServer.ANY_ADDRESS) // if not set, default is LOOPBACK |
| 82 | + .build(); |
112 | 83 |
|
113 | | -server.execute(); // it starts Netty server and blocks current thread |
| 84 | +server.run(); // it starts the server and blocks the current thread |
114 | 85 | // ... |
115 | 86 | ``` |
0 commit comments