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

Expose actual number of bytes transferred in ReadRawData and possibly other commands #185

Closed
pepijndevos opened this issue Jul 24, 2020 · 1 comment

Comments

@pepijndevos
Copy link
Contributor

On my Rigol scope, when using the LXI transport, the scope sometimes sends less data than requested, which leads to stale data from another channel in a temp buffer being rendered, see https://github.com/azonenberg/scopehal-apps/issues/146#issuecomment-663620558

To correctly fix this issue, these commands need to expose the actual number of bytes read (and written?)

I suppose as of yet, no other scope is so broken that it's a big problem, but I think that for API stability and correctness sake, any network IO function should be prepared to handle incomplete data and report the number of bytes transferred.

@azonenberg
Copy link
Collaborator

All of the other transports use Socket::ReadLooped/WriteLooped(), which call read(2) and write(2) in a loop until exactly the requested number of bytes have been sent.

So while they can hang, they can never return partial data. Except in the case of a socket timeout, which we probably should handle.

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

2 participants