Reputation: 15
I'm using Erlang for the first time, and when I tried to create a node, it bugged out. According to the manual, this should work, but that may be linux.
Do i have to initialize something on Windows for nodes to work?
Erlang/OTP 18 [erts-7.1] [64-bit] [smp:4:4] [async-threads:10]
Eshell V7.1 (abort with ^G)
1> erl -sname ping
1> node().
* 1: syntax error before: ping
1> node().
nonode@nohost
2>
Upvotes: 0
Views: 209
Reputation: 49
The erl -sname is command line for creating and naming a node. -sname stands for shortname and is used to name/identify nodes on same machine or same subnet on different machine.Once u start ERTS by erl -sname ping ,you are naming the node as ping and thereafter doing node() will give you ping@nohost instead of [email protected] can find more details in Distributed Progrmming chapter of Joe Armstrong Erlang book http://www.amazon.in/Programming-Erlang-Joe-Armstrong/dp/9351104672/ref=sr_1_2?ie=UTF8&qid=1445756132&sr=8-2&keywords=erlang+book .The book is an excellent for beginers.
Upvotes: 0
Reputation: 20004
The erl -sname ping
command is what you run to start Erlang. Here, you entered it instead at the Erlang shell prompt, which is incorrect.
You should start over by first exiting this Erlang shell either by typing q().
followed by Enter, or by pressing Ctrl g and then at the next prompt typing q
followed by enter Enter. This should get you back out to your Windows shell. Then, enter erl -sname ping
and once you get the Erlang shell 1>
prompt again, you can run the node().
function.
Upvotes: 2