farhadi / farhadi/node-smpp

Session Randomly dropped by the server | ECONNRESET

Open
#251 12 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
435
Forks
194
PR merge metrics
No merged PRs in 30d

Description

Hello,

I have a decent understanding of this library. However, I cannot resolve a random disconnection issue that keeps happening. Every few minutes or sometimes hours, the client gets disconnected from the SMPP server and gives only the following error in the logs
```
2024-03-22T11:30:38: Error: read ECONNRESET
2024-03-22T11:30:38: at TCP.onStreamRead (node:internal/stream_base_commons:217:20) {
2024-03-22T11:30:38: errno: -104,
2024-03-22T11:30:38: code: 'ECONNRESET',
2024-03-22T11:30:38: syscall: 'read'
2024-03-22T11:30:38: }
```

I have tried inspecting this but there is no error I can pinpoint that cause this. TCP dump taken reveals that the server sends [FIN, ACK] packet that causes disconnection. My best guess is that the client does not send "enquire_link" quickly enough and this causes disconnection. The client cannot change the enquire_link_interval period which is 60 seconds. Is there a way to increase the window we wait for enquire_link PDU before we disconnect? Is my understanding flawed here?

Also, I tried handling this by using `session.on("error", (){})` but it doesn't work. I cannot even catch and log this error.

I would appreciate any help.

-Thanks in advance

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.