anchor.diff:  recv(Socket, Timeout) ->
   	gen_fsm:sync_send_event(Socket, {recv, Timeout}).
   
  -%% @doc set the controlling process to a new owner. Can only suceede if
  +%% @doc set the controlling process to a new owner. Can only succede if
   %% called from the current owner.
   -spec controlling_process(Socket :: websocket(), NewOwner :: pid()) -> 'ok' | {'error', 'not_owner'}.
   controlling_process(Socket, NewOwner) ->
  
positive.code: 	gen_fsm:sync_send_all_state_event(Socket, {setopts, Opts}).
  
  %% @doc Like ping/2 with an infinite timeout.
  -spec ping(Socket :: websocket) -> 'pong' | 'pang' | {'error', 'closed'}.
  ping(Socket) ->
  	ping(Socket, infinity).
  
  %% @doc Send a ping message to the server, blocking the calling process
  %% until either the timeout is reached or a reply is given.
  -spec ping(Socket :: websocket, Timeout :: timeout()) -> 'pong' | 'pang' | {'error', 'closed'}.
  ping(Socket, Timeout) ->
  	gen_fsm:sync_send_all_state_event(Socket, {ping, Timeout}).
  
  %% @private
  %% gen_fsm api
  init([Controller, Url, Opts, Timeout]) ->
  	OptsRec = build_opts(Opts),
  	Before = now(),
  
negative.code: init(close, _From, {State, _Opts, _Timeout}) ->
  	{reply, ok, closed, State}.
  
  %% @private
  init(_Msg, State) ->
  	{next_state, init, State}.
  
  