Replies: 5 comments 12 replies
-
You need to use |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
After studying the emqtt.erl module in the emqtt application I realized that the problems with the emqtt module result in an error because the "clientid = ClientId," in the options that make up the loop data for the generic process in the code named "State" is not initialized. In fact it can never be initialized because when the emqtt: start_link/0 or start_link/1is called to create a client (in my case through my com2.erl module), the clientId can only be returned no matter which init/0 or init/1 function is invoked base on options passed to it, the ClientId is made available only when the init/0 or init/1 function returns to from start_link/0 or start_link/1. The ClientId is the Pid value in the {ok, Pid} tuple returned from start_link/0 or start_link/1 is the ClientId, e.g. (ClientId = Pid). Although, the ClientId is passed to functions in the calls in the emqtt module, e.g.
other functions that are called internally in the emqtt module are expecting the ClientId in the State loop variable which is not initialized. init([Options]) -> From my perspective this is a design failure in the emqtt module. The problem shows up when a user if the emqtt application goes about trying to create his/her own emqtt OTP client. |
Beta Was this translation helpful? Give feedback.
-
Hi emqtt team, when call the following functions from my Erlang/OTP com2.erl module I get no errors
However when I call these functions
my com2.erl process dies.
This happens regardless of whether I make a "gen_statem:call/2" or "gen_statem:cast/2". Here is a snapshot of my module where the aforementioned calls are made
Is there a special way that I need to call these functions from my process so that my com2.erl process does not die? Without the function calls my process does not die. |
Beta Was this translation helpful? Give feedback.
-
this is emqtt related, here is emqx, pls create issue in |
Beta Was this translation helpful? Give feedback.
-
Hi emqtt team,
I'm having problems trying to determine which of the following functions I should use properly connect to emqtt. By trial and error I have found that this is the only function that does not return an error is the uncommented one in the code snippet below.
Assuming that the function I used is correct, when I run the following code to carry out a subscription, I get a timeout error event though I've extended it
When I run the code I get this error report
I been trying to find a solution to this problem for over a week now, with no success. So I really need your help - please.
Beta Was this translation helpful? Give feedback.
All reactions