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

Added an optional message terminator option for read methods. #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

CetinOzdil
Copy link

Hi,

Actually this pull request is somehow linked to my previous pull request. In short if we send a request to a device and expect for example 25 bytes long response but instead we receive 13 bytes response to complete read TcpClient will wait until timeout. But some devices (like the one i am working with now) have fixed message termination sequences (like { 0x03, 0x02 } or line feed etc. ) So to eleminate extra wait I added an option to read methods to search received data for message termination sequence and if found finalize reading and resize stream according to sequence position.

@jchristn
Copy link
Owner

Hi @CetinOzdil thanks for putting this together! I will take a look. Re: my comment on your other PR, this one could make it much easier for someone to build their own framing - e.g. "read until you receive \r\n\r\n" or something similar.

@tdietrich513
Copy link

@jchristn This would eliminate a lot of code for me- how are things looking?

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 this pull request may close these issues.

3 participants