How to make gen_mc_session asyncronous ?

Help
nobody
2010-10-24
2013-05-21
  • nobody
    nobody
    2010-10-24

    gen_mc_session submit_sm requests handling should be asyncrounous. otherwise delay of one request processing affects to the next requests.

    Latest oserl version's gen_mc_session bound_trx state function does a synchronous call  as below.

    bound_trx({CmdId, _Pdu} = R, St)
      when CmdId == ?COMMAND_ID_SUBMIT_SM ->
        handle_peer_operation(R, St), 
        {next_state, bound_trx, St};
    

    above handle_peer_operation() is a synchronous function.

    but in previous oserl version, handle_peer_operation is asyncronous as below.

    bound_trx({CmdId, _Pdu} = R, S) when CmdId ==  CmdId == ?COMMAND_ID_SUBMIT_SM ->
        reset_timer(S#state.inactivity_timer),
        reset_timer(S#state.enquire_link_timer),
        Self = self(),
        spawn_link(fun() -> handle_peer_operation(R, Self, S) end),  % Asynchronous
        {next_state, bound_trx, S};
    

    How can i get gen_mc_session asynchronous? where have i done the mistake?
    Thanks.

     
  • Arsénio Costa
    Arsénio Costa
    2011-04-29

    Interesting question, im facing an issue on oserl,
    when i bind as a transceiver, if the submit_sm and deliver_sm troughtput is high enough i get a crash on the gen_esme session ….

     
  • Please excuse me,  I replied to this question time ago, but I don't know where it went.

    This was my reply  (I believe you are facing the same issue).

    --

    Hi,

    You are not making any mistakes, that spawn_link should not have been removed. 

    I'm trying to log in into sourceforge to push the changes but I cannot get through.  handle_peer_operation should be:

    handle_peer_operation({CmdId, Pdu}, St) ->
    spawn_link(
      fun() ->
          CmdName = ?COMMAND_NAME(CmdId),
          SeqNum = smpp_operation:get_value(sequence_number, Pdu),
          RespId = ?RESPONSE(CmdId),
          Sock = St#st.sock,
          Log = St#st.log,
          case (St#st.mod):handle_operation(St#st.mc, {CmdName, Pdu}) of
            {ok, PList1} ->
              PList2  = ,
              Params = smpp_operation:merge(PList1, PList2),
              send_response(RespId, ?ESME_ROK, SeqNum, Params, Sock, Log),
              true;
            {error, Error} ->
              send_response(RespId, Error, SeqNum, , Sock, Log),
              false
          end
      end).

    In both, gen_esme_session.erl and gen_mc_session.erl.

    Best regards,

    Enrique

    BTW: I found sourceforge very slow.  I tried to log in three times during these days and I gave up.  Finally I managed to do it today.  Was me or the site?