anchor.diff:                  end),
       Pid.
   
  -
  -send({_Address, _Port, Socket}, Pid, Message) ->
  +-spec send({inet:ip_address(), integer(), inet:socket()}, pid(), term()) ->
  +                   ok.
  +send({Address, Port, Socket}, Pid, Message) ->
       BinaryMessage = term_to_binary({deliver, Pid, Message}),
  -    erlang:port_command(Socket, BinaryMessage),
  -    ok.
  +    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),
  
positive.code: ].
  
  %% @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()}
  open_new(Address, Port, undefined, MyPort) ->
      Myself = self(),
      LocalPid = spawn(fun () ->
  
negative.code:             end;
  
          {youare, _IP, _Port} ->
              loop(Socket, Address, Port);
  
          Unknown ->
  