anchor.diff:      {error, Reason} ->
         {stop, {error, Reason}, State}
     end;
  +
   handle_cast(stop, State) ->
     {stop, normal, State}.
   
  
positive.code: -spec init(#apns_connection{}) -> {ok, state()} | {stop, term()}.
  init(Connection) ->
    try
  	SSLParameters = [{certfile, filename:absname(Connection#apns_connection.cert_file)},
  					{mode, binary} |
                	  		case Connection#apns_connection.key_file of
  							undefined -> [];
  							KeyFile -> [{keyfile, filename:absname(KeyFile)}]
  					end],
  	SSLParameters2 =  case Connection#apns_connection.cert_password of
  						undefined -> SSLParameters;
  						Password -> [{password, Password} | SSLParameters]
  					end,
      case ssl:connect(
             Connection#apns_connection.apple_host,
             Connection#apns_connection.apple_port,
             SSLParameters2,
             Connection#apns_connection.timeout) of
        {ok, OutSocket} ->
          case ssl:connect(
                 Connection#apns_connection.feedback_host,
                 Connection#apns_connection.feedback_port,
                 [{certfile, filename:absname(Connection#apns_connection.cert_file)},
                  {mode, binary}|
                    case Connection#apns_connection.key_file of
                      undefined -> [];
                      KeyFile2 -> [{keyfile, filename:absname(KeyFile2)}]
                    end],
                 Connection#apns_connection.timeout) of
            {ok, InSocket} ->
              {ok, #state{out_socket  = OutSocket,
                          in_socket   = InSocket,
                          connection  = Connection}};
            {error, Reason} ->
              {stop, Reason}
          end;
        {error, Reason} ->
          {stop, Reason}
      end
    catch
      _:{error, Reason2} ->
        {stop, Reason2}
    end.
  
  %% @hidden
  
negative.code:     NextBuffer -> %% We need to wait for the rest of the message
        {noreply, State#state{in_buffer = NextBuffer}}
    end;
  
  handle_info({ssl_closed, SslSocket}, State = #state{in_socket = SslSocket,
                                                      connection= Connection}) ->
    error_logger:info_msg("Feedback server disconnected. Waiting ~p millis to connect again...~n",
                          [Connection#apns_connection.feedback_timeout]),
    _Timer = erlang:send_after(Connection#apns_connection.feedback_timeout, self(), reconnect),
    {noreply, State#state{in_socket = undefined}};
  
  handle_info(reconnect, State = #state{connection = Connection}) ->
    error_logger:info_msg("Reconnecting the Feedback server...~n"),
    case open_feedback(Connection) of
      {ok, InSocket} -> {noreply, State#state{in_socket = InSocket}};
      {error, Reason} -> {stop, {in_closed, Reason}, State}
    end;
  
  handle_info({ssl_closed, SslSocket}, State = #state{out_socket = SslSocket}) ->
    error_logger:info_msg("APNS disconnected~n"),
    {noreply, State#state{out_socket=undefined}};
  
  handle_info(Request, State) ->
    {stop, {unknown_request, Request}, State}.
  
  