hop:name/0. From 2012?
This commit is contained in:
parent
dfcd70cb70
commit
0921a0f4f2
|
@ -17,7 +17,10 @@
|
||||||
|
|
||||||
-module(hop).
|
-module(hop).
|
||||||
|
|
||||||
-export([register_idempotent/3, class_of/1, send/2, post/4]).
|
-export([name/0, register_idempotent/3, class_of/1, send/2, post/4]).
|
||||||
|
|
||||||
|
name() ->
|
||||||
|
list_to_binary(atom_to_list(node())).
|
||||||
|
|
||||||
register_idempotent(Name, Pid, ClassModule) ->
|
register_idempotent(Name, Pid, ClassModule) ->
|
||||||
case global:register_name(Name, Pid) of
|
case global:register_name(Name, Pid) of
|
||||||
|
|
|
@ -85,8 +85,7 @@ handle_cast({socket_control_transferred, Sock}, State0 = #state{sock = Sock}) ->
|
||||||
inet:setopts(Sock, [binary]),
|
inet:setopts(Sock, [binary]),
|
||||||
request_data(Sock),
|
request_data(Sock),
|
||||||
State1 = send([<<"hop">>], State0),
|
State1 = send([<<"hop">>], State0),
|
||||||
State2 = send([<<"subscribe">>, list_to_binary(atom_to_list(node())), <<>>, <<>>, <<>>, <<>>],
|
State2 = send([<<"subscribe">>, hop:name(), <<>>, <<>>, <<>>, <<>>], State1),
|
||||||
State1),
|
|
||||||
{noreply, State2};
|
{noreply, State2};
|
||||||
handle_cast(_Request, State) ->
|
handle_cast(_Request, State) ->
|
||||||
{stop, {bad_cast, _Request}, State}.
|
{stop, {bad_cast, _Request}, State}.
|
||||||
|
|
Loading…
Reference in New Issue