← index #4484PR #14265
Related · medium · value 0.486
QUERY · ISSUE

module wiznet5k server not disconnecting prior to close

openby t35tB0topened 2019-02-10updated 2019-02-22
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

openby greezybaconopened 2024-04-07updated 2024-08-21
extmod

This adds support for the WIZnet chip:

  • Non-blocking support (ie. settimeout(0) or setblocking(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)
  • send and recv is supported on UDP sockets. (send requires a call to connect)
  • 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.

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied