anchor.diff:  
   handle_info({Closed, Sock}, #state{sock = Sock} = State)
     when Closed == tcp_closed; Closed == ssl_closed ->
  +    %% TODO flush queue
       {stop, sock_closed, State};
   
   handle_info({Error, Sock, Reason}, #state{sock = Sock} = State)
     when Error == tcp_error; Error == ssl_error ->
  +    %% TODO flush queue
       {stop, {sock_error, Reason}, State};
   
   handle_info({_, Sock, Data2}, #state{data = Data, sock = Sock} = State) ->
  
positive.code:     end.
  
  terminate(_Reason, _State) ->
      %% TODO send termination msg, close socket
      ok.
  
  code_change(_OldVsn, State, _Extra) ->
      {ok, State}.
  
  %% -- internal functions --
  
  start_ssl(S, Flag, Opts, State) ->
      ok = gen_tcp:send(S, <<8:?int32, 80877103:?int32>>),
  
negative.code: -behavior(gen_server).
  
  -export([start_link/0,
           connect/5,
           close/1,
           get_parameter/2,
           squery/2,
           equery/3,
           parse/4,
           bind/4,
           execute/4,
           describe/3,
           close/3,
           sync/1,
           cancel/1]).
  
  -export([handle_call/3, handle_cast/2, handle_info/2]).
  