anchor.diff:  -module(wsecli).
   -behaviour(gen_fsm).
   
  --export([start/3]).
  +-export([start/3, stop/0]).
   -export([init/1, connecting/2, open/2, closing/2, closed/2]).
   -export([handle_event/3, handle_sync_event/4, handle_info/3, terminate/3, code_change/4]).
   
  
positive.code: start(Host, Port, Path)->
    {ok, Pid} = gen_fsm:start_link({local, wsecli}, ?MODULE, {Host, Port, Path}, [{timeout, 5000}]),
    Pid.
  
  
  %
  
negative.code: handle_event(Event, StateName, StateData) ->
    ok.
  
  -spec handle_sync_event(stop, pid(), atom(), #data{}) -> {stop, stop, term(), #data{}}.
  handle_sync_event(stop, _From, _StateName, StateData) ->
    {stop, normal, stopping, StateData};
  
  handle_sync_event(Event, From, StateName, StateData) ->
    ok.
  
  handle_info(Info, StateName, StateData) ->
    ok.
  
  -spec terminate(stop, atom(), #data{}) -> [].
  terminate(normal, _StateName, StateData) ->
    gen_tcp:close(StateData#data.socket).
  
  code_change(OldVsn, StateName, StateData, Extra) ->
    ok.
  