File tree 1 file changed +13
-18
lines changed
libraries/ESP8266WiFi/src/include
1 file changed +13
-18
lines changed Original file line number Diff line number Diff line change 1
- /*
1
+ /*
2
2
ClientContext.h - TCP connection handling on top of lwIP
3
3
4
4
Copyright (c) 2014 Ivan Grokhotkov. All rights reserved.
5
5
This file is part of the esp8266 core for Arduino environment.
6
-
6
+
7
7
This library is free software; you can redistribute it and/or
8
8
modify it under the terms of the GNU Lesser General Public
9
9
License as published by the Free Software Foundation; either
@@ -39,7 +39,7 @@ class ClientContext {
39
39
tcp_sent (pcb, &_s_sent);
40
40
tcp_err (pcb, &_s_error);
41
41
}
42
-
42
+
43
43
err_t abort (){
44
44
if (_pcb) {
45
45
DEBUGV (" :abort\r\n " );
@@ -52,7 +52,7 @@ class ClientContext {
52
52
}
53
53
return ERR_ABRT;
54
54
}
55
-
55
+
56
56
err_t close (){
57
57
err_t err = ERR_OK;
58
58
if (_pcb) {
@@ -71,7 +71,7 @@ class ClientContext {
71
71
}
72
72
return err;
73
73
}
74
-
74
+
75
75
~ClientContext () {
76
76
}
77
77
@@ -101,18 +101,18 @@ class ClientContext {
101
101
}
102
102
}
103
103
}
104
-
104
+
105
105
void setNoDelay (bool nodelay){
106
106
if (!_pcb) return ;
107
107
if (nodelay) tcp_nagle_disable (_pcb);
108
108
else tcp_nagle_enable (_pcb);
109
109
}
110
-
110
+
111
111
bool getNoDelay (){
112
112
if (!_pcb) return false ;
113
113
return tcp_nagle_disabled (_pcb);
114
114
}
115
-
115
+
116
116
uint32_t getRemoteAddress () {
117
117
if (!_pcb) return 0 ;
118
118
@@ -277,16 +277,11 @@ class ClientContext {
277
277
278
278
void _error (err_t err) {
279
279
DEBUGV (" :er %d %d %d\r\n " , err, _size_sent, _send_waiting);
280
- if (err != ERR_ABRT) {
281
- abort ();
282
- }
283
- else {
284
- tcp_arg (_pcb, NULL );
285
- tcp_sent (_pcb, NULL );
286
- tcp_recv (_pcb, NULL );
287
- tcp_err (_pcb, NULL );
288
- _pcb = NULL ;
289
- }
280
+ tcp_arg (_pcb, NULL );
281
+ tcp_sent (_pcb, NULL );
282
+ tcp_recv (_pcb, NULL );
283
+ tcp_err (_pcb, NULL );
284
+ _pcb = NULL ;
290
285
if (_size_sent && _send_waiting) {
291
286
esp_schedule ();
292
287
}
You can’t perform that action at this time.
0 commit comments