2020
2121 published under the same license.
2222
23- Last updated April 17th , 2016
23+ Last updated April 23rd , 2016
2424 */
2525
2626#ifndef WIFI_SERVER_STREAM_H
@@ -40,16 +40,15 @@ class WiFiServerStream : public WiFiStream
4040 */
4141 virtual inline bool connect_client ()
4242 {
43- if ( _client && _client.connected () ) return true ;
44-
45- if ( _connected )
43+ if ( _connected )
4644 {
45+ if ( _client && _client.connected () ) return true ;
4746 stop ();
4847 }
4948
5049 // passive TCP connect (accept)
5150 WiFiClient newClient = _server.available ();
52- if ( !newClient ) return false ;
51+ if ( !newClient ) return false ;
5352 _client = newClient;
5453 _connected = true ;
5554 if ( _currentHostConnectionCallback )
@@ -72,11 +71,11 @@ class WiFiServerStream : public WiFiStream
7271 */
7372 virtual inline bool maintain ()
7473 {
75- if ( connect_client () ) return true ;
74+ if ( connect_client () ) return true ;
7675
7776 stop ();
7877
79- if ( !_listening && WiFi.status () == WL_CONNECTED )
78+ if ( !_listening && WiFi.status () == WL_CONNECTED )
8079 {
8180 // start TCP server after first WiFi connect
8281 _server = WiFiServer (_port);
@@ -92,7 +91,7 @@ class WiFiServerStream : public WiFiStream
9291 */
9392 virtual inline void stop ()
9493 {
95- if ( _client)
94+ if ( _client)
9695 {
9796 _client.stop ();
9897 if ( _currentHostConnectionCallback )
0 commit comments