Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MLLP client doesn't receive full ack response when expected #44

Open
cezio opened this issue Feb 24, 2022 · 1 comment · May be fixed by #49
Open

MLLP client doesn't receive full ack response when expected #44

cezio opened this issue Feb 24, 2022 · 1 comment · May be fixed by #49

Comments

@cezio
Copy link

cezio commented Feb 24, 2022

MLLP client sends HL7 message properly, the server receives it, and tries to send ack message back. However, in many systems, probably due to low-level implementation details, HL7 ack message is divided into smaller chunks and send back as separate TCP packets.

MLLP client may receive the first \x0b byte from the response, which is the beginning of the MLLP envelope, then it will close the connection, due to use of ctx manager. Client will never receive full MSH+MSA message. This is against the protocol, and may cause various problems on the other system starting with inability to confirm reception of the message on it's side.

I don't have any solution for this yet, but temporary solution would to read the response until some deadline before closing the connection.

@anibal2j
Copy link

I have the exact same issue. I'm not sure if the problem is with the ctx manager. From looking at the code the actual implementation of the receive code seems faulty. It's just reading once from the network buffer and that's it. That part of the code should have to iterate reading from the socket, until either the connection is closed or there's a timeout, or there's an end in the MLLP envelope. I don't see any of that in the code. I tried fixing it but I can't get it to work.

Appreciate it if somebody would provide a patch. I can definitely provide testing and feedback.

cezio added a commit to cezio/python-hl7 that referenced this issue Jun 10, 2022
@cezio cezio linked a pull request Jun 10, 2022 that will close this issue
cezio added a commit to cezio/python-hl7 that referenced this issue Aug 16, 2022
* mllp_client code updated to react on timeouts from socket, use of argparse instead of obsolete optparse
* tests updated to follow new features and convetions
cezio added a commit to cezio/python-hl7 that referenced this issue Aug 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants