feat(node-hl7-server): expose underlying socket on InboundRequest#15
Open
sleistner wants to merge 1 commit into
Open
feat(node-hl7-server): expose underlying socket on InboundRequest#15sleistner wants to merge 1 commit into
sleistner wants to merge 1 commit into
Conversation
Add a `socket` field to `InboundRequestProps` and a corresponding `InboundRequest.getSocket()` accessor so handlers can reach the underlying TCP/TLS socket the message arrived on. The `Inbound` listener already holds the live socket while it constructs the request and response objects; this change just forwards it through to the handler. Useful when the handler needs peer/local address pairs to make routing decisions that depend on connection-level metadata rather than message content. ## What changes - `InboundRequestProps` adds `socket: Socket`. - `InboundRequest` stores it and exposes `getSocket(): Socket`. - The two `new InboundRequest(...)` call sites in `Inbound` (`_handleMessages` and the single-message path in `_onTcpClientConnected`) now pass the active socket. The change is additive: existing consumers that ignore the new method are unaffected. Callers constructing `InboundRequest` directly (only seen in tests) must now include `socket` in the props. ## Test plan - Existing tests updated to pass the new prop. - New `InboundRequest - socket accessor returns the socket` test verifies the accessor wires through correctly.
Owner
|
@sleistner I swear I added this. Will do once I merge in my major changes. |
Owner
|
@sleistner can you put this into the v4.0.0 branch? |
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.
Summary
Add a
socketfield toInboundRequestPropsand a correspondingInboundRequest.getSocket()accessor so handlers can reach the underlying TCP/TLS socket the message arrived on.The
Inboundlistener already holds the live socket while it constructs the request and response objects; this PR just forwards it through to the handler. Useful when the handler needs peer/local address pairs to make routing decisions that depend on connection-level metadata rather than message content.What changes
InboundRequestPropsgainssocket: Socket.InboundRequeststores it and exposesgetSocket(): Socket.new InboundRequest(...)call sites inInbound(in_handleMessagesand the single-message path of_onTcpClientConnected) now pass the active socket.The change is additive: existing consumers that ignore the new method are unaffected. Callers constructing
InboundRequestdirectly (only seen in tests) must now includesocketin the props.Test plan
InboundRequesttests updated to pass the new prop.InboundRequest - socket accessor returns the sockettest verifies the accessor wires through correctly.