anchor.diff:      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}]),
  
positive.code: on_close(Callback) ->
    gen_fsm:send_all_state_event(wsecli, {on_close, Callback}).
  
  %
  % GEN_FSM behaviour functions
  %
  -spec init({Host::string(), Port::integer(), Resource::string()}) -> {ok, connecting, #data{}}.
  init({Host, Port, Resource}) ->
    %error_logger:info_msg("Start wsecli \n"),
  
negative.code: code_change(OldVsn, StateName, StateData, Extra) ->
    code_change.
  
  %%%%%%%%%%%%%%%%%%%%%
  %
  % GEN FSM INTERNAL
  %
  %%%%%%%%%%%%%%%%%%%%%
  -spec process_messages(Messages :: list(#message{}), StateData :: #data{}) -> #data{}.
  process_messages([], StateData) ->
    StateData;
  