From 94184a9c63c456d4c0a0459e8ae8e535c70e8c2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikael=20=27Lilleman=27=20G=C3=B6ransson?= Date: Wed, 2 Sep 2026 12:40:51 +0200 Subject: [PATCH] Re-wrap the shutdown paragraph and leave the throw-versus-rejection note in one place --- README.md | 14 +++++++------- test/session-extras.test.ts | 1 - 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 9d879ae..0c13ad8 100644 --- a/README.md +++ b/README.md @@ -332,13 +332,13 @@ TypeScript users can import `SmppLog` to have the compiler check one. `sendSms()`, `send()`, `sendReturn()`, `unbind()` and `close()`. Both `close()` and `unbind()` refuse further sends, wait out the requests this end already sent for up to `shutdownTimeout`, and then tear down whatever is left, resolving to an `err` that says what was lost. They also wait for -every `sms` still in the application's hands, so a peer whose `submit_sm` is -being handled is answered rather than left to re-send it. That wait ends when `sendResp()` puts the -response on the wire, or when every listener that took the message has failed; answering its PDUs -through `sendReturn()` instead leaves the wait running until it gives up. `sendDlr()` is the one send the refusal lets -past, and it catches the wait when issued straight after `sendResp()`; await anything in between and -it races the shutdown like any other send. `close({ signal })` takes an -`AbortSignal` that cuts the wait short; `unbind()` takes none, and waits a further +every `sms` still in the application's hands, so a peer whose `submit_sm` is being handled is +answered rather than left to re-send it. That wait ends when `sendResp()` puts the response on the +wire, or when every listener that took the message has failed; answering its PDUs through +`sendReturn()` instead leaves the wait running until it gives up. `sendDlr()` is the one send the +refusal lets past, and it catches the wait when issued straight after `sendResp()`; await anything in +between and it races the shutdown like any other send. `close({ signal })` takes an `AbortSignal` +that cuts the wait short; `unbind()` takes none, and waits a further `responseTimeout` for its own response. `send()` reaches any of the 33 SMPP commands the codec knows, not just the four the session handles natively: diff --git a/test/session-extras.test.ts b/test/session-extras.test.ts index c3a4925..e3e259f 100644 --- a/test/session-extras.test.ts +++ b/test/session-extras.test.ts @@ -1456,7 +1456,6 @@ describe('graceful shutdown', () => { assert.ok((await sent).err instanceof Error); }); - // A rejection leaves the other listeners running, unlike a throw, which stops emit() where it is. test('waits for the listener still working when another one rejected', async t => { const smpp = await startServer(t, { shutdownTimeout: 30_000 }); const failed = once(resolve => {