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

Crash after "Merge branch 'hiroeorz-master'" 7c6de640c6a3afadb6f9bb35d515411384a159ae #8

Closed
desoulter opened this issue Jan 23, 2015 · 2 comments

Comments

@desoulter
Copy link
Contributor

Hi,

I can't start emqtcc after 7c6de64 commit.

(messenger@127.0.0.1)2> {ok, Pid} = emqttc:start_link([{host, "test.mosquitto.org"}]).
** exception exit: {badmatch,false}
in function emqttc:init/1 (src/emqttc.erl, line 269)
in call from gen_fsm:init_it/6 (gen_fsm.erl, line 363)
in call from proc_lib:init_p_do_apply/3 (proc_lib.erl, line 239)
(messenger@127.0.0.1)3> 11:48:42.453 [error] CRASH REPORT Process <0.322.0> with 1 neighbours exited with reason: no match of right hand value false in emqttc:init/1 line 269 in gen_fsm:init_it/6 line 381

@emqplus
Copy link
Contributor

emqplus commented Jan 24, 2015

desoulter , pls use emqttc:start_link([{host, "localhost"}, {client_id, "clientId"}]). I will release a fix today

@emqplus
Copy link
Contributor

emqplus commented Feb 11, 2015

generate a random clientid if not provided.

init([Name, Args]) ->

  • true = proplists:is_defined(client_id, Args),
  • ClientId = proplists:get_value(client_id, Args),
  • %true = proplists:is_defined(client_id, Args),
  • {_, Secs, MicroSecs} = erlang:now(),
  • RandomId = list_to_binary(["emqttc-", integer_to_list(Secs), "-", integer_to_list(MicroSecs)]),
  • ClientId = proplists:get_value(client_id, Args, RandomId),

@emqplus emqplus closed this as completed Feb 11, 2015
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