anchor.diff:  %%                                   {stop, Reason, State}
   %% @end
   %%--------------------------------------------------------------------
  +
  +handle_info({ssl, Socket, Bin},#state{heart_beat = HeartBeat,socket = Socket,buff = Buff} = State) ->
  +  % Flow control: enable forwarding of next TCP message
  +  ok = ranch_ssl:setopts(Socket, [{active, false}]),
  +  {Packet,NewBuff} = unpack(<<Buff/bits,Bin/bits>>,[]),
  +  StateBuff = State#state{buff = NewBuff},
  +  NewState = packet(Packet,StateBuff),
  +  ok = ranch_ssl:setopts(Socket, [{active, once}]),
  +  {noreply,NewState,HeartBeat};
  +
  +handle_info({ssl_closed, Socket}, #state{socket = Socket} = State) ->
  +  {stop, ssl_closed, State};
  +
  +
   handle_info(timeout,#state{ip = IP,port = Port,connected = false,heart_beat = HeartBeat} = State )->
   	lager:log(info,?MODULE,"Try to connect to ~s:~p~n",[IP,Port]),
   	Result = ranch_ssl:connect(IP,Port,[]),
   	NewState = case Result of
   		{ok,Socket}->
  +			ok = ranch_ssl:setopts(Socket, [{active, once}]),
   			State#state{connected = true,socket = Socket};
   		{error,Error}->
   			lager:log(info,?MODULE,"Connect to ~s:~p fail. Reason: ~p~n",[IP,Port,Error]),
  
positive.code: %%                                   {stop, Reason, State}
  %% @end
  %%--------------------------------------------------------------------
  handle_call(_Request, _From, State) ->
  	Reply = ok,
  	{reply, Reply, State}.
  
negative.code: 	NewState = if 
  			Miss > 2 ->
  				ranch_ssl:close(Socket),
  				loop_close(),
  				State#state{connected = false,miss = 0,socket = undefined};
  			true -> 
  				Packet = pack(0,0,<<>>),
  				ranch_ssl:send(Socket,Packet),
  	 			State#state{miss = Miss + 1}
  	 		end,
  	{noreply,NewState,HeartBeat};
  
  handle_info({'DOWN', _MonitorRef, process, Pid, _Info},#state{socket = Socket} = State) -> 
  	hm_misc:demonitor(Pid,multiplex_monitor),
  	case ets:match_object(multiplex_mapper,{'_',Pid}) of
  		[] ->
  			{noreply,State};
  		[{ID,Pid}] ->
  			Close = pack(ID,3,<<>>),
  			ets:delete(multiplex_mapper,ID),
  			ranch_ssl:send(Socket,Close),
    		{noreply, State}
    end;
  
  handle_info(_Info, State) ->
  	{noreply, State}.
  