anchor.diff:  
   -include_lib("wsock/include/wsock.hrl").
   
  --export([start/3, stop/0, send/1]).
  --export([on_open/1, on_error/1, on_message/1, on_close/1]).
  +-export([start/3, start/4, stop/0, stop/1, send/1, send/2]).
  +-export([on_open/1, on_open/2, on_error/1, on_error/2, on_message/1, on_message/2, on_close/1, on_close/2]).
   -export([init/1, connecting/2, open/2, closing/2]).
   -export([handle_event/3, handle_sync_event/4, handle_info/3, terminate/3, code_change/4]).
   
  
positive.code: -spec send(Data::string()) -> ok;
            (Data::binary()) -> ok.
  send(Data) ->
    gen_fsm:send_event(wsecli, {send, Data}).
  
  %% @doc Add a callback to be called when a connection is opened
  %%
  
negative.code: %% The callback function must be a function which takes no parameters
  -spec on_open(Callback::fun()) -> any().
  on_open(Callback) ->
    on_open(?DEFAULT_REG_NAME, Callback).
  
  %% @doc Add a callback to be called when a connection is opened
  %%
  %% This callback is called when the connection is opened (after a successful websocket handshake)
  %%or inmediatelly if called while in the open state. Adding it not it connecting or open state will
  %%raise an error.
  %%
  %% The callback function must be a function which takes no parameters
  -spec on_open(Socket::pid()|atom(), Callback::fun()) -> any().
  on_open(Socket, Callback) ->
    gen_fsm:send_event(Socket, {on_open, Callback}).
  
  %% @doc Add a callback to be called when an error occurs
  %%
  