anchor.diff:  
   %% worth putting specs on these?
   
  -unopened({open, Socket, Connect}, From,
  +unopened({open, Socket, Receiver, Connect}, From,
            S0 = #state{ socket = undefined }) ->
  -    S = S0#state{ socket = Socket },
  +    S = S0#state{ socket = Socket, receiver = Receiver },
       write(S, Connect),
       case recv(S) of
           {ok, #connack{ return_code = ok }, Rest, S1} ->
  
positive.code:           socket = undefined,
            parse_fun = undefined,
            rpcs = gb_trees:empty(),
            id_counter = 1
           }).
  
  -type(connection() :: pid()).
  
negative.code:             From ! {Id, Reply},
              {next_state, opened, S0#state{ rpcs = RPC1 }};
          false ->
              %% TODO deal with QoS
              #state{ receiver = Receiver } = S0,
              Receiver ! {frame, Frame},
              {next_state, opened, S0}
      end;
  
  opened(disconnect, S0 = #state{ socket = Sock }) ->
  