QUERY · ISSUE
module wiznet5k server not disconnecting prior to close
port-stm32
When wiznet5K TCP sockets are being used as servers, client connections hang due to server closing socket without issuing proper FIN-ACK disconnect. Adding disconnect in the close() method fixes client handshake but breaks the socket del destructor method (system hangs, waits a long time for timeouts). The wiznet 5K socket disconnect method closes the socket but this command is never called (code pragma'd out).
CANDIDATE · PULL REQUEST
Add nonblocking support for WIZnet 5k NIC
extmod
This adds support for the WIZnet chip:
- Non-blocking support (ie.
settimeout(0)orsetblocking(False)) - DHCP runs in the background and will auto-renew the address or update it if the DHCP server assigns a different one
- DHCP runs on a dynamic socket, so it won't corrupt other usage of socket
#1 - DNS runs on a dynamic socket, so it won't corrupt other usage of socket
#2 - Interrupt pin is supported
- Sockets are otherwise polled on a 64ms interval (based on the lwIP-based interface)
sendandrecvis supported on UDP sockets. (sendrequires a call toconnect)- TCP_NODELAY option is supported
- Listener socket is automatically reinstated if no sockets are available when a client connection is accepted.
Using the WIZnet TCP/IP offload (without lwIP) reduces the code size by about 37k (on the RP2040), and static RAM usage by 28k.