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

Restore eol option on UDPWriter #387

Closed
webbpinner opened this issue May 8, 2024 · 1 comment
Closed

Restore eol option on UDPWriter #387

webbpinner opened this issue May 8, 2024 · 1 comment

Comments

@webbpinner
Copy link
Contributor

WIth the network re-factor the eol kwarg was removed. This was a useful argument for detecting the end of a data record and removing it before passing the record down the pike. Without it several ships are reporting duplicate carriage returns in the data files.

Would like to see the eol kwarg added back with the default set to '\n'

webbpinner added a commit to webbpinner/openrvdas that referenced this issue May 8, 2024
webbpinner added a commit to webbpinner/openrvdas that referenced this issue May 9, 2024
davidpablocohn pushed a commit that referenced this issue May 9, 2024
* Attempt at fix for #387

* Made the return statements a bit more concise
@veggiemike
Copy link
Contributor

Sorry, I'm late to the party. ;-)

The eol flag was removed because that's for stream parsing, and that's just not how UDP works. You send and receive entire datagrams at a time, unlike TCP streams. These setups that are getting duplicate '\n' are being sent strings ending in '\n', and then they're adding a 2nd '\n'. In other words, it's a bug somewhere else. We're just hiding it now by using eol to strip the '\n' off. I'd suggest using a transform to strip it off instead.

I haven't run into anything that sends multiple messages in a single UDP packet, but I suppose it is possible. These cases would benefit from eol I guess, although it still feels to me like something that should be handled downstream of UDPReader.

Setting eol='\n' certainly shouldn't be the default, as that would silently split any incoming UDP record with a '\n' in it. Just my $.02.

KaarelRaeis-SOI pushed a commit to schmidtocean/openrvdas that referenced this issue Jul 26, 2024
* Attempt at fix for OceanDataTools#387

* Made the return statements a bit more concise
KaarelRaeis-SOI pushed a commit to schmidtocean/openrvdas that referenced this issue Aug 23, 2024
* Attempt at fix for OceanDataTools#387

* Made the return statements a bit more concise
KaarelRaeis-SOI pushed a commit to schmidtocean/openrvdas that referenced this issue Aug 23, 2024
* Attempt at fix for OceanDataTools#387

* Made the return statements a bit more concise
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

No branches or pull requests

3 participants