How to make gen_mc_session asyncronous ?

  • 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 ->
        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?

  • 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 ….

  • Enrique Marcote Peńa

    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).



    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) ->
      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(, {CmdName, Pdu}) of
            {ok, PList1} ->
              PList2  = ,
              Params = smpp_operation:merge(PList1, PList2),
              send_response(RespId, ?ESME_ROK, SeqNum, Params, Sock, Log),
            {error, Error} ->
              send_response(RespId, Error, SeqNum, , Sock, Log),

    In both, gen_esme_session.erl and gen_mc_session.erl.

    Best regards,


    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?


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks