anchor.diff:  ].
   
   %% @doc open new connection
  -%% @spec open_new(inet:ip_address(), int(), inet:ip_address(), int()) ->
  -%%       {local_ip, inet:ip_address(), int(), pid(), inet:socket()}
  -%%     | fail
  -%%     | {connection, pid(), inet:socket()}
  +-spec open_new(inet:ip_address(), integer(), inet:ip_address() | undefined, integer()) ->
  +       {local_ip, inet:ip_address(), integer(), pid(), inet:socket()}
  +     | fail
  +     | {connection, pid(), inet:socket()}.
   open_new(Address, Port, undefined, MyPort) ->
       Myself = self(),
       LocalPid = spawn(fun () ->
  
positive.code:             end;
  
          {youare, _IP, _Port} ->
              loop(Socket, Address, Port);
  
          {inet_reply, _S, Status} ->
              case Status of
                  ok ->
                      %% ?LOG_MESSAGE(Message, byte_size(BinaryMessage)),
                      ok;
                  {error, closed} ->
                      comm_server:unregister_connection(Address, Port),
                      close_connection(Socket);
                  {error, _Reason} ->
                      %% log:log(error,"[ CC ] couldn't send to ~p:~p (~p)",
                      %% [Address, Port, Reason]),
                      comm_server:unregister_connection(Address, Port),
                      close_connection(Socket)
              end,
              loop(Socket, Address, Port);
  
          Unknown ->
  
negative.code:                 end),
      Pid.
  
  -spec send({inet:ip_address(), integer(), inet:socket()}, pid(), term()) ->
                     ok.
  send({Address, Port, Socket}, Pid, Message) ->
      BinaryMessage = term_to_binary({deliver, Pid, Message}),
      case gen_tcp:send(Socket, BinaryMessage) of
  	ok ->
  	    ?LOG_MESSAGE(Message, byte_size(BinaryMessage)),
  	    ok;
  	{error, closed} ->
  	    comm_server:unregister_connection(Address, Port),
  	    close_connection(Socket);
  	{error, _Reason} ->
              %% log:log(error,"[ CC ] couldn't send to ~p:~p (~p)", [Address, Port, Reason]),
  	    comm_server:unregister_connection(Address, Port),
  	    close_connection(Socket)
      end.
  
  loop(fail, Address, Port) ->
      comm_server:unregister_connection(Address, Port),
  