各种有用的erlang行为
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

20 lines
307 B

-module(pong2).
-behavior(gen_srv).
-compile([export_all, nowarn_export_all]).
start() ->
gen_srv:start(?MODULE, 0, []).
init(_Args) ->
{ok, 0}.
handleCall(ping, _State, _From) ->
{reply, pong}.
handleCast(_Msg, State) ->
{noreply, State}.
handleInfo(_Msg, State) ->
{noreply, State}.