Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't get hello world example to work #1

Closed
BjRo opened this issue Apr 19, 2014 · 2 comments
Closed

Can't get hello world example to work #1

BjRo opened this issue Apr 19, 2014 · 2 comments
Assignees

Comments

@BjRo
Copy link

BjRo commented Apr 19, 2014

Hey there,

this might potentially be a noob question, but I've got trouble getting the simplest 'Hello World' example two work.

I've started to read the ZMQ book and wanted to port the examples over to elixir. The code I'm talking about is located here https://github.com/BjRo/zguide/commit/fdcf59738cfa86afd674ff72ee890893a41cf01a

The server seems to start correctly. However when I try to connect a client from a different shell I get this:

* Generic server <0.60.0> terminating
** Last message in was {connect,tcp,{127,0,0,1},5555,[]}
** When Server state == {'Elixir.Exzmq.Socket',<0.2.0>,
                            {'Elixir.Exzmq.Socket.Fsm.FsmState',
                                'Elixir.Exzmq.Socket.Req',idle,
                                {'Elixir.Exzmq.Socket.Req.State',none}},
                            <<>>,passive,[],none,[],none,[],[],[],[]}
** Reason for termination ==
** {noproc,{gen_server,call,
                       ['Elixir.Exzmq.Link.Sup',{start_child,[]},infinity]}}
** exit {{:noproc, {:gen_server, :call, [Exzmq.Link.Sup, {:start_child, []}, :infinity]}}, {:gen_server, :call, [#PID<0.60.0>, {:connect, :tcp, {127, 0, 0, 1}, 5555, []}]}}
    (stdlib) gen_server.erl:180: :gen_server.call/2
    (zmq) lib/hwclient.ex:5: Zmq.HWclient.run/0
    (stdlib) erl_eval.erl:655: :erl_eval.do_apply/6
    (elixir) src/elixir.erl:140: :elixir.eval_forms/4
    (elixir) lib/code.ex:130: Code.do_eval_string/3
    (elixir) lib/enum.ex:517: Enum."-each/2-lists^foreach/1-0-"/2
    (elixir) lib/enum.ex:517: Enum.each/2
    (mix) lib/mix/tasks/run.ex:53: Mix.Tasks.Run.run/1

It looks like a missed pattern match in connect. Is there something obvious I'm doing wrong? Is it the way I start things via mix run -e "Zmq.HWclient.run"?

@plemanach plemanach self-assigned this Apr 19, 2014
@plemanach
Copy link
Member

Hi,

You need to start the exzmq OTP application, you can add this to you mix file

def application do
    [
      applications: [:exzmq]
    ]
  end

@BjRo
Copy link
Author

BjRo commented Apr 19, 2014

Man, I knew I was missing something really obvious :-)

Thx, works like a charm now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants