anchor.diff:              Port = dest_port(State),
               report_bundle_error(Options, {Address, Port, Pid}, Message,
                                   Reason),
  -            log:log(error,"[ CC ~p ] couldn't send to ~.0p:~.0p (~.0p). closing connection",
  -                    [self(), Address, Port, Reason]),
  +            log:log(error,"[ CC ~p (~p) ] couldn't send message (~.0p). closing connection",
  +                    [self(), pid_groups:my_pidname(), Reason]),
               close_connection(Socket, set_number_of_timeouts(State, 0))
       end.
   
  
positive.code:             Port = dest_port(State),
              report_bundle_error(Options, {Address, Port, Pid}, Message,
                                  socket_closed),
              log:log(warn,"[ CC ~p ] sending closed connection", [self()]),
              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]),
                      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]),
                      Address = dest_ip(State),
                      Port = dest_port(State),
                      report_bundle_error(Options, {Address, Port, Pid}, Message,
  
negative.code:                 _ = inet:setopts(Socket, [{active, once}]),
                  inc_r_msg_count(State);
              {user_close} ->
                  log:log(warn,"[ CC ~p (~p) ] tcp user_close request", [self(), pid_groups:my_pidname()]),
                  close_connection(Socket, State);
              Unknown ->
                  log:log(warn,"[ CC ~p (~p) ] unknown message ~.0p", [self(), pid_groups:my_pidname(), Unknown]),
                  %% may fail, when tcp just closed
                  _ = inet:setopts(Socket, [{active, once}]),
                  State
  