Commit 79cdc5c
committed
Default to 4K receive buffer size
Change the _sync method so that when no specific size is requested it
fetches up to 4096 bytes instead of 1 byte at a time from the
operating system. It's not clear what the reason was for setting it 1
byte. It was introduced in pymodbus commit:
9d2c864
Patch:
3b490fe
But there's no rationale there for setting it to 1 byte specifically.
While it may have been to handle some obscure operating system with a
poor network stack implementation this should have been documented, as
it is written it comes across as that the implementer didn't
understand how the TCP/stream socket networking API works.
Note that https://docs.python.org/3/library/socket.html does not
contain a full description on the socket.recv method; see also pydoc
for socket.socket.recv.1 parent 5f5b427 commit 79cdc5c
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
261 | 261 | | |
262 | 262 | | |
263 | 263 | | |
264 | | - | |
| 264 | + | |
265 | 265 | | |
266 | | - | |
| 266 | + | |
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
| |||
0 commit comments