[<<][thermostat][>>][..]
Fri Feb 2 11:03:30 EST 2018

UDP reconnects dont't work properly

f(Pid), Pid = serv:start({handler,fun()-> #{ port => gen_udp:open(2001) } end, fun(Msg,State) -> io:format("~p~n",[Msg]),State end}).

tom@beaglebone:~/erl_tools$ ./erl.sh 
Erlang/OTP 19 [erts-8.2.1] [source] [async-threads:10] [kernel-poll:false]

Eshell V8.2.1  (abort with ^G)
1> f(Pid), Pid = serv:start({handler,fun()-> #{ port => gen_udp:open(2001) } end, fun(Msg,State) -> io:format("~p~n",[Msg]),State end}).
<0.59.0>
{udp,#Port<0.335>,{10,1,3,2},57594,[112,16]}
{udp,#Port<0.335>,{10,1,3,2},57594,[112,16]}
{udp,#Port<0.335>,{10,1,3,2},57594,[112,16]}


root@zoo:/i/tom/git/temperv14# ./temperv14.elf 
1070 16.44 61.59
1070 16.44 61.59
1070 16.44 61.59


Works now.

Next: load temperv14.elf automatically from udev.
OK



[Reply][About]
[<<][thermostat][>>][..]