anchor.diff:          {error, Reason} ->
               {error, Reason}
       end.
  +
  +p_write_request(Port, Request, Msg) ->
  +    Size = size(Msg),
  +    Buffer = <<Request:32/integer-signed-little,Size:32/integer-signed-little,Msg/binary>>,
  +    Port ! {self(), {command, Buffer}}.
  +
  +p_read_reply(Port) ->
  +    receive
  +        {Port, {data, <<Size:32/integer-signed-little,Msg/binary>>}} ->
  +            {Size, Msg}
  +    end.
  
positive.code: %%--------------------------------------------------------------------
  terminate(Reason, State) ->
      #{worker := WorkerPort} = State,
      port_close(WorkerPort),
      lager:info("Terminating with reason: ~p", [Reason]),
      ok.
  
negative.code: %% gen_server callbacks
  -export([init/1, handle_call/3, handle_cast/2, handle_info/2,
           terminate/2, code_change/3]).
  
  
  %% Request types (enum receiver::Request) from "cvmfs.git/cvmfs/receiver/reactor.h"
  -define(kQuit,0).
  -define(kEcho,1).
  -define(kGenerateToken,2).
  -define(kGetTokenId,3).
  -define(kSubmitPayload,4).
  -define(kError,5).
  
  
  %%%===================================================================
  