adafruit / Adafruit_CircuitPython_Wiznet5k

Pure-Python interface for WIZNET 5k Ethernet modules
Other
15 stars 37 forks source link

Shorter socket exit timeout #97

Closed BiffoBear closed 1 year ago

BiffoBear commented 1 year ago

closes 89, 90 Decreased socket.socket.__exit__ timeout from 1000 seconds to 19 seconds to match the Wiznet5k hardware defaults.

e28eta commented 1 year ago

I don't think this'll close #89, but it does look good to me for #90. I filed them as separate issues because I think they're different problems.

dhalbert commented 1 year ago

I don't think this'll close #89, but it does look good to me for #90. I filed them as separate issues because I think they're different problems.

@BiffoBear Do you have a comment on this?

BiffoBear commented 1 year ago

I don't think this'll close #89, but it does look good to me for #90. I filed them as separate issues because I think they're different problems.

@BiffoBear Do you have a comment on this?

Good point well made. The documents are a little ambiguous, so I've gone through the C source code from the Wiznet drivers.

socket.__exit__() now follows the logic of the Wiznet driver for disconnecting and closing. I've taken the opportunity to remove calls to deprecated socket.socket() methods, as they just call the WIZNET5K methods anyway.

Cheers, Martin

BiffoBear commented 1 year ago

But please note that the default hardware timeout for a TCP socket is about 19 seconds.