We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 03ea7d9 commit 0bad837Copy full SHA for 0bad837
hardware/esp8266com/esp8266/libraries/ESP8266WiFi/src/include/ClientContext.h
@@ -284,11 +284,24 @@ class ClientContext
284
void _error(err_t err)
285
{
286
DEBUGV(":er %d\r\n", err);
287
- _pcb = 0;
288
- if (_size_sent && _send_waiting)
289
- esp_schedule();
290
291
- }
+ if(_pcb) {
+ tcp_arg(_pcb, NULL);
+ tcp_sent(_pcb, NULL);
+ tcp_recv(_pcb, NULL);
292
+ tcp_err(_pcb, NULL);
293
+ err = tcp_close(_pcb);
294
+ if(err != ERR_OK) {
295
+ DEBUGV(":tc err %d\r\n", err);
296
+ tcp_abort(_pcb);
297
+ }
298
299
+ _pcb = 0;
300
+
301
+ if(_size_sent && _send_waiting) {
302
+ esp_schedule();
303
304
305
306
err_t _poll(tcp_pcb* pcb)
307
0 commit comments