We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5b30bff commit 10fd755Copy full SHA for 10fd755
pslab/connection/wlan.py
@@ -101,7 +101,16 @@ def write(self, data: bytes) -> int:
101
numbytes : int
102
Number of bytes written.
103
"""
104
- return self._sock.sendall(data)
+ buf_size = 4096
105
+ remaining = len(data)
106
+ sent = 0
107
+
108
+ while remaining > 0:
109
+ chunk = data[sent : min(remaining, buf_size)]
110
+ sent += self._sock.send(chunk)
111
+ remaining -= len(chunk)
112
113
+ return sent
114
115
def __repr__(self) -> str: # noqa
116
return f"{self.__class__.__name__}[{self.host}:{self.port}]"
0 commit comments