Fix API for Windows
This commit is contained in:
parent
6aef3fe0ac
commit
8aec59f32b
3
Documentation/UserManual/SCPI_Examples/libreVNA.py
Normal file → Executable file
3
Documentation/UserManual/SCPI_Examples/libreVNA.py
Normal file → Executable file
@ -5,6 +5,7 @@ import time
|
||||
class SocketStreamReader:
|
||||
def __init__(self, sock: socket.socket):
|
||||
self._sock = sock
|
||||
self._sock.setblocking(0)
|
||||
self._recv_buffer = bytearray()
|
||||
self.timeout = 1.0
|
||||
|
||||
@ -59,7 +60,7 @@ class SocketStreamReader:
|
||||
if bytes_read == len(view):
|
||||
return bytes_read
|
||||
try:
|
||||
bytes_read += self._sock.recv_into(view[bytes_read:], 0, socket.MSG_DONTWAIT)
|
||||
bytes_read += self._sock.recv_into(view[bytes_read:], 0)
|
||||
except:
|
||||
pass
|
||||
return bytes_read
|
||||
|
Loading…
Reference in New Issue
Block a user