Commit Graph

11 Commits

Author SHA1 Message Date
Jeff Epler 57756863ef
picow: depending on memory pressure, may only be able to write 1 MSS
Foamyguy discovered that trying to send >2920 bytes at once consistently
failed. I further discovered that sometimes trying to send >1460 bytes
would fail too.  By "fail", I mean that it would take a very long time
(around 200 * 50ms) before erroneously reporting that all bytes were
written.

In my testing, this change causes larger writes to successfully
send either 2920 or 1460 bytes (possibly after doing some 50ms waits
for a previous packet to clear).

The documentation of socket.send always stated that it COULD send fewer
bytes than requested, but adafruit_httpserver assumed that the number
of requested bytes were always sent, so after this change alone,
adafruit_httpserver will still not work properly.

Closes: #7077 (albeit fixes are needed in adafruit_httpserver too)
2022-10-17 19:42:07 -05:00
Jeff Epler 861b22730e
picow: if initial write fails, write at most 1 TCP MSS of data 2022-10-17 19:28:02 -05:00
Georg Bøe e768b9ebb3 Return correct errno 2022-10-13 21:00:51 +02:00
Jeff Epler ca9523b814
Pico w: socket: Correctly return negative error code from recv_into 2022-10-12 11:38:29 -05:00
Jeff Epler 62cbd3bcd8
Pico w: socket: correctly track sockets generated by accept() 2022-10-12 11:38:26 -05:00
Jeff Epler afc1c0e3bb
Fix unused variable diagnostics, make it a fatal error 2022-09-30 11:19:22 -05:00
Jeff Epler 37620d4eb0
Fix several classes of compiler diagnostic & make fatal
* -Wno-nested-externs
 * -Wno-strict-prototypes
 * -Wno-double-promotion
 * -Wno-sign-compare
2022-09-30 11:19:22 -05:00
Jeff Epler 74cdf42ece
pico w: implement bind, listen, accept
this works with some simple tcp & udp echo service code
2022-09-29 10:02:20 -05:00
Jeff Epler 09d4fbc557
Remove FIXME
this was verbatim-copied from micropython
2022-09-28 14:38:13 -05:00
Jeff Epler ff7731491e
Implement enough of socketpool to do ntp and non-https requests 2022-09-28 10:06:34 -05:00
Jeff Epler a7a1bd7880
Implement DNS resolution
```
>>> s = socketpool.SocketPool(wifi.radio)
>>> s.getaddrinfo("google.com", 80)
[(0, 0, 0, '', ('142.250.81.206', 80))]
```
2022-09-28 10:06:33 -05:00