Repository navigation
Version Packages - #16
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to master, this PR will be updated.
Releases
@semyonf/smpp@1.8.0
Minor Changes
bf9cefd: Add an
auto_unbind_responseoption toconnect()andcreateServer()(defaultfalse): thesession answers an incoming
unbindwith anunbind_respof statusESME_ROK, stops itsenquire_linkschedule and closes the connection (destroying the socket once theunbind_resphasbeen flushed, so
'close'follows even if the peer never closes its side), before emitting the'pdu'and'unbind'events. Can be changed at runtime throughsession.autoUnbindResponse. It isoff by default so that handlers which already answer
unbindkeep working as they are.bf9cefd: Fix a session silently going deaf after one of its listeners threw, and add a
'listener_error'event.
An exception thrown by a
'pdu'or command listener, or by aresponseCallback, unwound the readloop with its busy flag still set, after which every further
'readable'event was ignored and thesession stopped reading the socket for good (an
enquire_link_timeoutwould destroy it, nothingresumed it). An exception in a
'debug'/'metrics'listener ordebugListenerdid the same, andduring
pdu.command.inwas reported as an'error'of the session as if the stream were corrupt. Athrowing
'send'listener skipped thesendCallback, a throwingfailureCallbackduring'close'skipped the other pending requests and the
'close'event itself, and a throwing'response_timeout'listener skipped the request'sfailureCallback.Every listener and callback the session calls is now isolated: the exception is emitted as a
'listener_error'event with{ error, event, pdu }(typeListenerErrorReport), and rethrown onthe next tick when nothing listens for it, so it still surfaces as an uncaught exception, but no
longer from inside
send()/resume(), and only after the rest of the chunk has been handled. The'error'event without a listener is rethrown the same way instead of throwing synchronously out ofthe socket handler, where it left the stream stuck.
A pdu that cannot be parsed (bad length, truncated body) now destroys the connection after the
'error'event, as the README always said. Until now the session kept the socket open but neverread it again.
bf9cefd: Add an
'outgoing'event, emitted synchronously fromsession.send()for every pdu handed to thesocket: requests and responses, including the automatic
enquire_link,enquire_link_respandunbind_resp.The
'send'event is emitted from the write callback, and Node does not guarantee that it runsbefore the response is read, so the response to a request could be emitted as
'pdu'before therequest's own
'send'.'outgoing'is emitted once thesequence_numberis assigned, right aftersocket.write()was called, so for a request it always comes before the'pdu'event of itsresponse. It is not emitted when
send()returnsfalseor throws.Also, a pdu that cannot be encoded no longer leaves a pending request behind:
send()still throws,but nothing waits for a response that was never asked for.
bf9cefd: Add
session.localAddressandsession.localPort, set together withremoteAddress/remotePort(on connect for a client session, on creation for a server session, always from the socket that
carries the TCP connection) and, like them, kept after the connection has closed, when the socket
itself has forgotten its local address. On a proxy-protocol session
remoteAddress/remotePortstill come from the PROXY header, while the local address is that of the TCP connection from the
proxy. Also fixes the client
'connect'handler, which fell back toremoteAddressinstead of theprevious
remotePortwhen the socket reported no peer port.