anchor.diff:                   tracker = Tracker} = StateData) ->
       TLSSocket = Connection:socket([Pid, self()], Transport, Socket, Connection, Tracker),
       {next_state, ?FUNCTION_NAME, StateData, [{reply, From, {ok, TLSSocket}}]};
  -connection({call, From}, {dist_handshake_complete, _Node, DHandle}, #data{connection_pid = Pid} = StateData) ->
  +connection({call, From}, {dist_handshake_complete, _Node, DHandle},
  +           #data{connection_pid = Pid,
  +                 socket_options = #socket_options{packet = Packet}} =
  +               StateData) ->
       ok = erlang:dist_ctrl_input_handler(DHandle, Pid),
       ok = ssl_connection:dist_handshake_complete(Pid, DHandle),
       %% From now on we execute on normal priority
       process_flag(priority, normal),
  -    Events = dist_data_events(DHandle, []),
  -    {next_state, ?FUNCTION_NAME, StateData#data{dist_handle = DHandle}, [{reply, From, ok} | Events]};
  +    {next_state, ?FUNCTION_NAME, StateData#data{dist_handle = DHandle},
  +     [{reply, From, ok}
  +      | case dist_data(DHandle, Packet) of
  +            [] ->
  +                [];
  +            Data ->
  +                [{next_event, internal,
  +                  {application_packets,{self(),undefined},Data}}]
  +        end]};
  +connection(internal, {application_packets, From, Data}, StateData) ->
  +    send_application_data(Data, From, ?FUNCTION_NAME, StateData);
  +%%
   connection(cast, {ack_alert, #alert{} = Alert}, #data{connection_pid = Pid} =StateData0) ->
       StateData = send_tls_alert(Alert, StateData0),
       Pid ! {self(), ack_alert},
  
positive.code: 
  %%---------------Erlang distribution --------------------------------------
  
  dist_data_events(DHandle, Events) ->
      case erlang:dist_ctrl_get_data(DHandle) of
          none ->
              erlang:dist_ctrl_get_data_notification(DHandle),
              lists:reverse(Events);
          Data ->
              Event = {next_event, {call, {self(), undefined}}, {application_data, Data}},
              dist_data_events(DHandle, [Event | Events])
      end.
  
  consume_ticks() ->
  
negative.code:      StateData#data{connection_states = 
                          ConnectionStates0#{current_write => WritesState},
                      negotiated_version = Version}};
  %%
  connection(info, dist_data,
             #data{dist_handle = DHandle,
                   socket_options = #socket_options{packet = Packet}} =
                 StateData) ->
      {next_state, ?FUNCTION_NAME, StateData,
        case dist_data(DHandle, Packet) of
            [] ->
                [];
            Data ->
                [{next_event, internal,
                 {application_packets,{self(),undefined},Data}}]
        end};
  connection(info, tick, StateData) ->  
      consume_ticks(),
      {next_state, ?FUNCTION_NAME, StateData, 
  