     GenServer.call(esme, {:handle_send_pdu_result, pdu, send_pdu_result})
   end
 
+  # GenServer callbacks
+
   def init([host, port, mod_with_args, transport, timeout, esme_opts]) do
     esme = self
     handler = fn(ref, _socket, _transport, session) ->


  defp resp?(pdu), do: Pdu.command_id(pdu) > 0x80000000

  def do_handle_pdu(pdu, st) do
    new_module_state = st.module.handle_pdu(pdu, st.module_state)
    new_timers = SMPPTimers.handle_peer_transaction(st.timers, st.time)
    {:reply, :ok, %ESME{ st | module_state: new_module_state, timers: new_timers }}
  end

  def do_handle_resp(pdu, st) do
    sequence_number = Pdu.sequence_number(pdu)
    new_timers = SMPPTimers.handle_peer_action(st.timers, st.time)
    new_st = %ESME{ st | timers: new_timers }


  @callback handle_close(state) :: any

  # Public interface

  def start_link(host, port, {module, args}, opts \\ []) do
    transport = Keyword.get(opts, :transport, :tcp)
    gen_server_opts = Keyword.get(opts, :gen_server_opts, [])
