Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rebind on reconnecting to smsc is not working #248

Open
elhananjair opened this issue Feb 14, 2024 · 2 comments
Open

Rebind on reconnecting to smsc is not working #248

elhananjair opened this issue Feb 14, 2024 · 2 comments

Comments

@elhananjair
Copy link

Hello friends I have a multiple socket RST problem from SMSC, and I tried to fix it using reconnect, I can see the reconnection going well but I couldn't be sure if the reconnect is working.

here is how I am trying to reconnect:

 session.socket.on('close', () => {
        console.log("Connection to SMSC closed, trying to reconnect...");
        setTimeout(() => {
            try {
                //session.unbind();
                //session.destroy();
                session.connect();
            }catch (e) {
                console.log("Error trying to reconnect with SMSC: " + e.message)
            }

        }, 5000);
    })
    
    
     session.on('connect', () => {
        console.log("Connection to SMSC established");
        session.bind_transceiver({system_id: "032332", password: "mypass"}, function (pdu) {
             console.log("Bind Transceiver request have made...")
             if (pdu.command_status === 0) { 
                  console.log("Successfully bound!");
                  session.submit_sm({...})
            }
        })
   })
@MartianH
Copy link

MartianH commented Nov 6, 2024

Reconnecting with this lib is ill-advised as it will reconnect on your side but the connection might still appear dead server-side. The best solution as of now is here: #90 (comment).

Though it had problems, so I replied with my own here: #90 (comment)

@elhananjair
Copy link
Author

Hello @MartianH
Thanks for the suggestion, this problem got me in a fight with different companies acting as SMSC, currently, I am shifting to C++ to re-develop the application I have developed through this library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants