@@ -55,19 +55,6 @@ class NetworkServer : public Server
5555 delete _server;
5656 _server = nullptr ;
5757 }
58- // for (uint8_t i = 0; i < PVT_SERVER_MAX_CLIENTS; i++)
59- // {
60- // if (_ethernetClient[i])
61- // {
62- // delete _ethernetClient[i];
63- // _ethernetClient[i] = nullptr;
64- // }
65- // if (_wifiClient[i])
66- // {
67- // delete _wifiClient[i];
68- // _wifiClient[i] = nullptr;
69- // }
70- // }
7158 }
7259
7360 // ------------------------------
@@ -79,16 +66,12 @@ class NetworkServer : public Server
7966#if defined(COMPILE_ETHERNET)
8067 if (_networkType == NETWORK_TYPE_ETHERNET)
8168 if (_server)
82- {
8369 ((EthernetServer *)_server)->begin ();
84- }
8570#endif // COMPILE_ETHERNET
8671#if defined(COMPILE_WIFI)
8772 if (_networkType == NETWORK_TYPE_WIFI)
8873 if (_server)
89- {
9074 ((WiFiServer *)_server)->begin ();
91- }
9275#endif // COMPILE_WIFI
9376 }
9477
@@ -104,10 +87,6 @@ class NetworkServer : public Server
10487 if (_networkType == NETWORK_TYPE_ETHERNET)
10588 if (_server)
10689 {
107- // if (!_ethernetClient[index])
108- // _ethernetClient[index] = new EthernetClient;
109- // if (!_ethernetClient[index])
110- // return nullptr;
11190 _ethernetClient[index] = ((EthernetServer *)_server)->available ();
11291 return &_ethernetClient[index];
11392 }
@@ -116,10 +95,6 @@ class NetworkServer : public Server
11695 if (_networkType == NETWORK_TYPE_WIFI)
11796 if (_server)
11897 {
119- // if (!_wifiClient[index])
120- // _wifiClient[index] = new WiFiClient;
121- // if (!_wifiClient[index])
122- // return nullptr;
12398 _wifiClient[index] = ((WiFiServer *)_server)->available ();
12499 return &_wifiClient[index];
125100 }
@@ -226,15 +201,6 @@ class NetworkServer : public Server
226201return 0 ;
227202 }
228203
229- void statusreport () // EthernetServer only - and only if uncommented in EthernetServer.cpp
230- {
231- #if defined(COMPILE_ETHERNET)
232- if (_networkType == NETWORK_TYPE_ETHERNET)
233- if (_server)
234- ((EthernetServer *)_server)->statusreport ();
235- #endif // COMPILE_ETHERNET
236- }
237-
238204 protected:
239205
240206 // ------------------------------
@@ -283,6 +249,7 @@ class NetworkWiFiServer : public NetworkServer
283249 public:
284250
285251 NetworkWiFiServer (uint16_t port) :
252+ _wifiServer{WiFiServer (port)},
286253 NetworkServer (&_wifiServer, NETWORK_TYPE_WIFI, port)
287254 {
288255 }
0 commit comments