anchor.diff:  next_record(#state{protocol_buffers = #protocol_buffers{tls_packets = [], tls_cipher_texts = []},
   		   socket = Socket,
   		   transport_cb = Transport} = State) ->
  -    tls_socket:setopts(Transport, Socket, [{active,once}]),
  -    {no_record, State};
  +    case tls_socket:setopts(Transport, Socket, [{active,once}]) of
  +	ok ->
  +	    {no_record, State};
  +	_ ->
  +	    {socket_closed, State}
  +    end;
   next_record(State) ->
       {no_record, State}.
   
  
positive.code: next_event(StateName, Record, State) ->
      next_event(StateName, Record, State, []).
  
  next_event(connection = StateName, no_record, State0, Actions) ->
      case next_record_if_active(State0) of
  	{no_record, State} ->
  	    ssl_connection:hibernate_after(StateName, State, Actions);
  	{#ssl_tls{} = Record, State} ->
  	    {next_state, StateName, State, [{next_event, internal, {protocol_record, Record}} | Actions]};
  	{#alert{} = Alert, State} ->
  
negative.code:             %% Fixes non-delivery of final TLS record in {active, once}.
              %% Basically allows the application the opportunity to set {active, once} again
              %% and then receive the final message.
              next_event(StateName, no_record, State)
      end;
  handle_info(Msg, StateName, State) ->
  