pyvisa / pyvisa-py

A pure python PyVISA backend
https://pyvisa-py.readthedocs.io
MIT License
282 stars 120 forks source link

add flush to TCPIP SOCKET #350

Closed dkriegner closed 1 year ago

dkriegner commented 1 year ago

This PR attempts to add support for the flush operation of TCPIP Sockets.

For Sockets the read buffer operations of flush seem to be equal to clear. Since the writing to the sockets is blocking it seems no write buffer operations are possible/needed.

dkriegner commented 1 year ago

I would need some feedback on the proposed changes and in particular the comment above about the discard/flush of the write buffer.

Of course this PR would not fix #348 but hopefully improve the situation

MatthieuDartiailh commented 1 year ago

I will need to dive a bit in the VISA spec to answer this meaningfully so it may take me some time. Ping me if you see nothing by mid-February.

codecov-commenter commented 1 year ago

Codecov Report

Merging #350 (b72126f) into main (8a0753b) will decrease coverage by 0.69%. The diff coverage is 33.33%.

:exclamation: Current head b72126f differs from pull request most recent head f057e35. Consider uploading reports for the commit f057e35 to get more accurate results

:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##             main     #350      +/-   ##
==========================================
- Coverage   23.13%   22.44%   -0.69%     
==========================================
  Files          22       21       -1     
  Lines        3277     3226      -51     
  Branches      450      447       -3     
==========================================
- Hits          758      724      -34     
+ Misses       2501     2484      -17     
  Partials       18       18              
Flag Coverage Δ
unittests 22.44% <33.33%> (-0.69%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pyvisa_py/tcpip.py 20.73% <33.33%> (+0.14%) :arrow_up:

... and 8 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

MatthieuDartiailh commented 1 year ago

Sorry for the slow responses. Could you rebase on latest main ? I will try to merge quickly once it is done

dkriegner commented 1 year ago

I fixed the merge conflict. you prefer a real rebase (with a force push)?

MatthieuDartiailh commented 1 year ago

Usually yes but that's fine.