Reputation: 41
i have
then i:
in erl
c("/usr/home/ec2-user/ezmq/examples/hwclient.erl").
c("/usr/home/ec2-user/ezmq/examples/hwserver.erl").
hwserver:main().
and have error
exception error: undefined function ezmq:start/1 in function hwserver:main/0 (/usr/home/ec2-user/ezmq/examples/hwserver.erl, line 14)
and have error
exception error: undefined function ezmq:start/1 in function hwclient:main/0 (/usr/home/ec2-user/ezmq/examples/hwclient.erl, line 14)
how i compile and run
this https://github.com/zeromq/ezmq/blob/master/examples/hwclient.erl + hwserver.erl
examples?
and i have error
** exception exit: {{undef,[{gen_listener_tcp,start_link,
[ezmq_tcp_socket,
[<0.49.0>,<<>>,5555,
[binary,inet,
{active,false},
{send_timeout,5000},
{backlog,10},
{nodelay,true},
{packet,raw},
{reuseaddr,true}]],
[]],
[]},
{ezmq,handle_call,3,[{file,"src/ezmq.erl"},{line,238}]},
{gen_server,handle_msg,5,
[{file,"gen_server.erl"},{line,585}]},
{proc_lib,init_p_do_apply,3,
[{file,"proc_lib.erl"},{line,239}]}]},
{gen_server,call,[<0.49.0>,{bind,tcp,5555,[]}]}}
in function gen_server:call/2 (gen_server.erl, line 180)
in call from hwserver:main/0 (/usr/home/ec2-user/ezmq/examples/hwserver.erl, line 15)
Upvotes: 1
Views: 9227
Reputation: 3685
This project uses rebar, so try this:
./rebar compile
In terminal 1, run: erl -pa ebin -pa /deps/gen_listener_tcp/ebin
The -pa
option tells the vm where to load beam files from.
In the erlang shell, run:
c("examples/hwserver")
hwserver:main().
In terminal 2, run: erl -pa ebin -pa /deps/gen_listener_tcp/ebin
In the erlang shell, run:
c("examples/hwclient")
hwclient:main().
You should see a bunch of output.
The make file seems to require putting rebar
in your path. Once you do that, you can try the make targets.
Upvotes: 4