farhadi / farhadi/node-smpp

Rebind on reconnecting to smsc is not working

Open
#248 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
435
Forks
194
PR merge metrics
No merged PRs in 30d

Description

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({...})
}
})
})
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.