anchor.diff:              Port = dest_port(State),
               report_bundle_error(Options, {Address, Port, Pid}, Message,
                                   socket_closed),
  -            log:log(warn,"[ CC ~p ] sending closed connection", [self()]),
  +            log:log(warn,"[ CC ~p (~p) ] sending closed connection", [self(), pid_groups:my_pidname()]),
               close_connection(Socket, set_number_of_timeouts(State, 0));
           {error, timeout} ->
               NumberOfTimeouts = number_of_timeouts(State),
               if  % retry 5 times
                   NumberOfTimeouts < 5 ->
  -                    log:log(error,"[ CC ~p ] couldn't send to ~.0p:~.0p (~.0p). retrying.",
  -                            [self(), dest_ip(State), dest_port(State), timeout]),
  +                    log:log(error,"[ CC ~p (~p) ] couldn't send message (~.0p). retrying.",
  +                            [self(), pid_groups:my_pidname(), timeout]),
                       send_internal(Pid, Message, Options, BinaryMessage, set_number_of_timeouts(State, NumberOfTimeouts + 1));
                   true ->
  -                    log:log(error,"[ CC ~p ] couldn't send to ~.0p:~.0p (~.0p). retried 5 times, now closing the connection.",
  -                            [self(), dest_ip(State), dest_port(State), timeout]),
  +                    log:log(error,"[ CC ~p (~p) ] couldn't send message (~.0p). retried 5 times, now closing the connection.",
  +                            [self(), pid_groups:my_pidname(), timeout]),
                       Address = dest_ip(State),
                       Port = dest_port(State),
                       report_bundle_error(Options, {Address, Port, Pid}, Message,
  
positive.code:                     Socket;
                  {error, Reason} ->
                      % note: this should not occur since the socket was just created with 'ok'
                      log:log(error,"[ CC ~p ] reconnect to ~.0p because socket is ~.0p",
                              [self(), Address, Reason]),
                      gen_tcp:close(Socket),
                      new_connection(Address, Port, MyPort, Channel)
              end;
          {error, Reason} ->
              log:log(info,"[ CC ~p ] couldn't connect to ~.0p:~.0p (~.0p)",
                      [self(), Address, Port, Reason]),
              fail
      end.
  
  
negative.code:     send_bundle_if_ready(NewState);
  
  on({tcp_closed, Socket}, State) ->
      log:log(warn,"[ CC ~p (~p) ] tcp closed", [self(), pid_groups:my_pidname()]),
      close_connection(Socket, State);
  
  on({tcp_error, Socket, Reason}, State) ->
      % example Reason: etimedout, ehostunreach
      log:log(warn,"[ CC ~p (~p) ] tcp error: ~p", [self(), pid_groups:my_pidname(), Reason]),
      %% may fail, when tcp just closed
      _ = inet:setopts(Socket, [{active, once}]),
      send_bundle_if_ready(State);
  