anchor.diff:          yes -> nop;
           no  -> shutdown(S#jsrv.peer,S)
       end,
  -    timer:send_after(500,?NERLOMSG(bye)),
  +    timer:send_after(500,?NERLOMSG(?TAG_OK,?NERLOMSGPART(call,bye))),
       log:info(self(),"stopping with state: ~w", [S]),
       {noreply, S#jsrv{stopping=true}};
   handle_cast(Msg,S) ->
  
positive.code:     {noreply, S}.
  
  % @hidden
  handle_info({Pid,{handshake}},S) ->
      % TODO only allow from peer
      log:debug(self(), "got handshake from: ~p", [Pid]),
      {noreply, S#jsrv{peer=Pid}};
  handle_info({Port,{data,"\n"}},S) when is_port(Port) ->
      {noreply,S};
  handle_info({Port,{data,Msg}},S) when is_port(Port) ->
      log:info(self(),"port says: ~p", [Msg]),
      {noreply,S};
  handle_info({From,{bye}},S) ->
      case S#jsrv.stopping of
          false -> 
              log:warn(self(), "ignore 'bye' while not in stopping state: ~p", [From]),
  
negative.code: -behaviour(gen_server).
  
  % public interface
  -export([send/2]).
  -export([start/0, start/1, start/2, start_link/0, start_link/1, start_link/2, stop/0]).
  
  % gen_server exports
  