anchor.diff:              ?MODULE:recv_loop(Socket, NewPending, NewBytesSend)
       end.
   
  -handle_message({?GEN, From, {send, Bin}}, Socket, Pending, BytesSend) ->
  -    Ret = maybe_flush(Socket, [Bin|Pending], BytesSend),
  -    gen_server:reply(From, ok),
  -    Ret;
  -handle_message({?GEN, From, {send_frame, Frame}}, Socket, Pending, BytesSend) ->
  +
  +handle_message({send, Bin}, Socket, Pending, BytesSend) ->
  +    maybe_flush(Socket, [Bin|Pending], BytesSend);
  +handle_message({send_frame, Frame}, Socket, Pending, BytesSend) ->
       Bin = emqtt_frame:serialise(Frame),
  -    Ret = maybe_flush(Socket, [Bin|Pending], BytesSend),
  -    gen_server:reply(From, ok),
  -    Ret;
  +    maybe_flush(Socket, [Bin|Pending], BytesSend);
   handle_message({inet_reply, _, ok}, _Socket, Pending, BytesSend) ->
       {Pending, BytesSend};
   handle_message({inet_reply, _, Status}, _, _, _) ->
  
positive.code:                              [MaybeMaskedSocket, [], {os:timestamp(), 0}])}.
  
  send(WriterPid, Bin) when is_binary(Bin) ->
      {ok, Res} = gen:call(WriterPid, ?GEN, {send, Bin}, infinity),
      Res;
  send(WriterPid, Frame) when is_tuple(Frame) ->
      {ok, Res} = gen:call(WriterPid, ?GEN, {send_frame, Frame}, infinity),
      Res.
  
  main_loop(Socket, Pending, BytesSend) ->
      process_flag(trap_exit, true),
  
negative.code:          recv_loop/3]).
  
  -define(HIBERNATE_AFTER, 5000).
  
  start_link(Transport, Socket) ->
      MaybeMaskedSocket =
  