Skip to content

Commit

Permalink
Merge pull request #344 from pyvisa/vxi11-write-fix
Browse files Browse the repository at this point in the history
tcpip: use max_recv_size as it is supposed to be used
  • Loading branch information
MatthieuDartiailh authored Dec 22, 2022
2 parents 5272310 + 40cac33 commit 89c982f
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions pyvisa_py/tcpip.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,16 +543,13 @@ def write(self, data: bytes) -> Tuple[int, StatusCode]:
Return value of the library call.
"""
send_end, _ = self.get_attribute(ResourceAttribute.send_end_enabled)
chunk_size = 1024

try:
flags = 0
num = len(data)
offset = 0

while num > 0:
if num <= chunk_size:
if num <= self.max_recv_size:
flags |= vxi11.OP_FLAG_END

block = data[offset : offset + self.max_recv_size]
Expand Down

0 comments on commit 89c982f

Please sign in to comment.