File tree 3 files changed +8
-4
lines changed
3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -9,12 +9,14 @@ extern "C" {
9
9
#include " EthernetServer.h"
10
10
#include " Dns.h"
11
11
12
- EthernetClient::EthernetClient () {
12
+ EthernetClient::EthernetClient ()
13
+ :_tcp_client(NULL ) {
13
14
}
14
15
15
16
/* Deprecated constructor. Keeps compatibility with W5100 architecture
16
17
sketches but sock is ignored. */
17
- EthernetClient::EthernetClient (uint8_t sock) {
18
+ EthernetClient::EthernetClient (uint8_t sock)
19
+ :_tcp_client(NULL ) {
18
20
UNUSED (sock);
19
21
}
20
22
@@ -181,7 +183,7 @@ uint8_t EthernetClient::status() {
181
183
// EthernetServer::available() as the condition in an if-statement.
182
184
183
185
EthernetClient::operator bool () {
184
- return _tcp_client != NULL ;
186
+ return ( _tcp_client && (_tcp_client-> state != TCP_CLOSING)) ;
185
187
}
186
188
187
189
bool EthernetClient::operator ==(const EthernetClient& rhs) {
Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ extern "C" {
9
9
EthernetServer::EthernetServer (uint16_t port)
10
10
{
11
11
_port = port;
12
+ _tcp_client[MAX_CLIENT] = {};
13
+ _tcp_server = {};
12
14
}
13
15
14
16
void EthernetServer::begin ()
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ public Server {
14
14
15
15
void accept (void );
16
16
public:
17
- EthernetServer (uint16_t );
17
+ EthernetServer (uint16_t port = 80 );
18
18
EthernetClient available ();
19
19
virtual void begin ();
20
20
virtual size_t write (uint8_t );
You can’t perform that action at this time.
0 commit comments