[erlang-questions] Different behavior of the timer starting from command line or Erlang shell
Sat Jun 13 10:54:26 CEST 2015
I know this is probabily a silly question, but I really cannot understand
the cause of following behavior: I have a small application* that
communicates (through a TCP connection) with a data logger, and downloads
data samples once per minute. To do that, the main function of the
application invokes the function that performs the TCP call and gets the
samples, and then it invokes timer:apply_interval with the same function as
parameter (and, of course, 60 seconds).
Now, if I open the Erlang shell and invoke the main function, everything
goes smooth; if I start the application from the command line (-s
main_module main_function), then the first sample is correctly downloaded,
but no other sample is collected.
After many different tries and experiments, I still have no clue why... I
mean, the main function is the same! Why two different behaviors?
I have also tried starting with boot_sasl, to get some logs, and after the
first sample is collected, the log reports
=PROGRESS REPORT==== 13-Jun-2015::10:49:43 ===
so I guess the timer server is correctly started... but my function is
* by "application" I don't mean an OTP application, I mean just three
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions