lilleman
b1c790b9a0
Retry a stream we cannot read, and cover the framer reset on attach
...
A framing or codec error tears the link down rather than the session, so
the loop retries it on a fresh socket with a fresh framer — which is what
a desynced stream needs. Removing that reset failed nothing before; the
reconnect test now leaves half a PDU on the dying link, and does.
`disconnected` counts failed links rather than outages, which the README
now says, and the transport wires its socket as it is built.
2026-08-31 22:27:16 +02:00
lilleman
b2d121b4f3
Emit exactly one close, and read the socket through a PduTransport
...
Ending a session while the link was down emitted nothing: the retried
drop had already torn it down, so close() found nothing left to do. The
terminal event is now guarded by its own flag rather than by `closed`.
The socket, the framer and the parse move to PduTransport, which is what
takes session.ts back under its line cap; `session.sock` reads through a
getter. The backoff also refuses an inverted pair and an unknown key.
2026-08-31 21:53:11 +02:00
lilleman
880454b4f4
Split a retried drop out of close, and range-check the backoff
...
`close` fires only where nothing will bring the session back; a drop the
reconnect loop will retry is `disconnected`, pairing with `reconnected`.
`minDelay: 0` never doubles, so the backoff never started — both delays
are range-checked now, and only `false` spells reconnect off.
2026-08-31 21:11:19 +02:00
lilleman
18177053bc
Re-bind a dropped client link by default, and take false to turn it off
...
Surviving a drop is most of what the session layer is for, and behind an
opt-in an application that never read the options table got none of it.
`reconnect` still takes `{ minDelay, maxDelay }` to retune the backoff;
`false` is the one spelling for off.
2026-08-31 20:18:29 +02:00
lilleman
140464802b
Put the submit_sm summary back on the function it describes and tidy the review nits
2026-08-30 23:12:22 +02:00
lilleman
706b61d6ca
Leave an unknown notation alone and read a receipt's TLV as the id the submit answered
2026-08-30 23:01:39 +02:00
lilleman
696e018b77
Derive the notation names from one table and refuse an smsIdFormat that is not the pair
2026-08-30 22:45:02 +02:00
lilleman
8e5b9bb556
Read a peer's submit and receipt message ids into one notation before comparing them
2026-08-30 22:35:09 +02:00
lilleman
fa720e244a
Drop the line count that drifts and reuse the delay helper
2026-08-30 21:09:19 +02:00
lilleman
7e8af3c308
Tear down at once on a peer unbind and stop reporting a reconnect after close
2026-08-30 21:01:46 +02:00
lilleman
66b7d90bbf
Let onClose end the session through the same path as every other close
2026-08-30 20:30:40 +02:00
lilleman
5c618e0061
Stop accepting before the drain and report the link that dropped during it
2026-08-30 20:27:38 +02:00
lilleman
bebd74b42b
Drain the requests already on the wire before close() and unbind() tear down
2026-08-30 20:08:36 +02:00
lilleman
5c797f5383
Forget the base closed longest ago rather than the one handed out again
2026-08-30 11:31:22 +02:00
lilleman
aa3cf41c7f
Merge a message id base once so a straggler cannot join a later report
2026-08-30 11:17:02 +02:00
lilleman
8a71dbbc87
Drop the arrangement comment and record the review's DlrMerger findings
2026-08-28 15:09:47 +02:00
lilleman
f4e55909a1
Keep the delivery-receipt merges across a reconnect instead of dropping them
2026-08-28 14:44:32 +02:00
lilleman
344249b080
Accept an async listener in the types and normalise any rejection reason
2026-08-27 23:07:48 +02:00
lilleman
a5fe43d7a9
Normalise a listener's rejection reason before routing it to sessionError
2026-08-27 22:41:26 +02:00
lilleman
0e8f298957
Route a rejecting async listener to sessionError instead of the process
2026-08-27 22:22:51 +02:00
lilleman
3c6195a938
Collapse the two id emptiness tests into one and pin the reassembler wording
2026-08-27 16:42:26 +02:00
lilleman
cf315737b7
Keep the body scrape for reserved message types and an empty receipt id marker
2026-08-27 16:32:01 +02:00
lilleman
c9c3121d40
Give the esm_class bits one owner beside the constants
2026-08-27 16:18:05 +02:00
lilleman
b9f77ec969
Decode a receipt body before reading it and stop an unnameable state TLV overriding it
2026-08-27 16:08:54 +02:00
lilleman
4c08fe8fa3
Classify a deliver_sm by esm_class and document the messageDlr precondition
2026-08-27 15:52:33 +02:00
lilleman
366fa26b1c
Enforce bind direction, cap segments per message and pin the README examples
2026-08-27 14:07:42 +02:00
lilleman
8d245c82c4
Declare the logger contract in the library instead of depending on @larvit/log
2026-08-27 13:42:58 +02:00
lilleman
ff3667e120
Reject a renumbered multipart total and check abort before the send window
2026-08-27 12:43:17 +02:00
lilleman
8a182604b7
Address the CodeRabbit review: inbound SMS, binary payloads and untrusted input
2026-08-27 11:52:43 +02:00
lilleman
884afdb87b
Stop a thrown listener escaping, bound what a peer can pin, and drop the body from failure responses
2026-08-27 10:55:34 +02:00
lilleman
5af75a3c57
Close the stability findings and settle the sendResp, sendSms and unbind contracts
2026-08-27 00:17:48 +02:00
lilleman
435fa42708
Decompose the codec, document the session surface and record the review decisions
2026-08-26 22:59:39 +02:00
lilleman
6d842a8539
Split the session, gate optional parameters on the peer version, own the SMPP version in defs
2026-08-26 22:41:28 +02:00
lilleman
f0858aacf8
Answer 3.4 binds with sc_interface_version and cover TLS with tests
2026-08-26 17:16:54 +02:00
lilleman
694c3a506e
Bind as SMPP 3.4 by default, with interfaceVersion to override it
2026-08-26 15:41:44 +02:00
lilleman
b671ebafb2
Fix merged DLR counting and close event, cover reconnect and reassembly
2026-08-25 16:58:13 +02:00
lilleman
fd2f98464f
Add session, client and server with the promise result API
2026-08-25 16:46:32 +02:00
lilleman
1827ab5964
Add PDU framing and delivery receipt parsing
2026-08-25 16:31:27 +02:00
lilleman
649e93cdde
Add the PDU codec with bounds-checked parsing and typed encoding
2026-08-25 16:28:59 +02:00
lilleman
db5dc8cd15
Add message helpers: segmentation, bit counting and SMPP time
2026-08-25 16:23:23 +02:00
lilleman
4299a8cc35
Add TLV and command tables with per-command parameter types
2026-08-25 16:19:06 +02:00
lilleman
854c89f609
Port SMPP definitions: constants, errors, encodings and wire types
2026-08-25 16:07:34 +02:00
lilleman
16c935bb18
Scaffold ESM TypeScript rewrite as @larvit/smpp
2026-08-25 16:02:27 +02:00