anchor.diff:                 [Cmd, Session],
                  State).
   
  +%% @disconnect
  +disconnect(_Frame, State) -> {stop, normal, State}.
  +
  +%% @private
  +unsupported(#stomp_frame{command = Cmd}, State) ->
  +    send_error(unsupported_command,
  +               "Command '~p' not supported.~n",
  +               [Cmd],
  +               State).
  +
  +%%
  +%% Socket Communication
  +%%
  +
   %% @private
   send_error(Message, Format, Args, State) ->
       send_error(Message, lists:flatten(io_lib:format(Format, Args)), State).
  
positive.code: %% @hidden
  handle_cast(stop, State) ->
      {stop, normal, State};
  handle_cast(Frame = #stomp_frame{}, State) ->
      case handle_frame(Frame, State) of
          {ok, NewState}           -> {noreply, NewState};
          {error, Error, NewState} -> {stop, Error, NewState}
      end;
  handle_cast(Msg, State) ->
      {stop, {unhandled_cast, Msg}, State}.
  
negative.code: %% @private
  send(Frame, State = #s{sock = Sock}) ->
      case gen_tcp:send(Sock, restomp:encode(Frame)) of
          ok    -> {noreply, State};
          Error -> {stop, Error, State}
      end.
  