anchor.diff:    {stop, normal, {ok, closing}, StateData};
   
   handle_sync_event(stop, _From, open, StateData) ->
  -  Message = wsecli_message:encode([], close),
  +  Message = wsock_message:encode([], [mask, close]),
     case gen_tcp:send(StateData#data.socket, Message) of
       ok ->
         gen_fsm:start_timer(?CLOSE_HANDSHAKE_TIMEOUT, waiting_close_reply),
  
positive.code:   {next_state, open, StateData};
  
  open({send, Data}, StateData) ->
    Message = wsecli_message:encode(Data, text),
    case gen_tcp:send(StateData#data.socket, Message) of
      ok ->
        ok;
  
negative.code: -module(wsecli).
  -behaviour(gen_fsm).
  
  %-include("wsecli.hrl").
  -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]).
  