anchor.diff:  on_close(Callback) ->
     gen_fsm:send_all_state_event(wsecli, {on_close, Callback}).
   
  -%
  -% GEN_FSM behaviour functions
  -%
  +%%%%%%%%%%%%%%%%%%%%%
  +%
  +% GEN FSM STATENAME FUNCTIONS
  +%
  +%%%%%%%%%%%%%%%%%%%%%
   -spec init({Host::string(), Port::integer(), Resource::string()}) -> {ok, connecting, #data{}}.
   init({Host, Port, Resource}) ->
     %error_logger:info_msg("Start wsecli \n"),
  
positive.code: code_change(OldVsn, StateName, StateData, Extra) ->
    code_change.
  
  %
  % Internal
  %
  -spec process_messages(Messages :: list(#message{}), StateData :: #data{}) -> #data{}.
  process_messages([], StateData) ->
    StateData;
  
negative.code:     fragmented_message = undefined :: #message{}
    }).
  
  %%%%%%%%%%%%%%%%%%%%%
  %
  % PUBLIC API
  %
  %%%%%%%%%%%%%%%%%%%%%
  
  -spec start(Host::string(), Port::integer(), Resource::string()) -> pid().
  start(Host, Port, Path)->
    {ok, Pid} = gen_fsm:start_link({local, wsecli}, ?MODULE, {Host, Port, Path}, [{timeout, 5000}]),
  