@@ -88,7 +88,7 @@ void WebSocketsClient::begin(const char * host, uint16_t port, const char * url,
8888 // todo find better seed
8989 randomSeed (millis ());
9090#endif
91- #if (WEBSOCKETS_NETWORK_TYPE == NETWORK_ESP8266_ASYNC)
91+ #if (WEBSOCKETS_NETWORK_TYPE == NETWORK_ESP8266_ASYNC)
9292 asyncConnect ();
9393#endif
9494
@@ -225,7 +225,7 @@ void WebSocketsClient::beginSocketIOSSLWithCA(const char * host, uint16_t port,
225225
226226#endif
227227
228- #if (WEBSOCKETS_NETWORK_TYPE != NETWORK_ESP8266_ASYNC)
228+ #if (WEBSOCKETS_NETWORK_TYPE != NETWORK_ESP8266_ASYNC)
229229/* *
230230 * called in arduino loop
231231 */
@@ -244,7 +244,7 @@ void WebSocketsClient::loop(void) {
244244 if (_client.isSSL ) {
245245 DEBUG_WEBSOCKETS (" [WS-Client] connect wss...\n " );
246246 if (_client.ssl ) {
247- #if (WEBSOCKETS_NETWORK_TYPE == NETWORK_WIFI_NINA) || (WEBSOCKETS_NETWORK_TYPE == NETWORK_SAMD_SEED) || (WEBSOCKETS_NETWORK_TYPE == NETWORK_UNOWIFIR4)
247+ #if (WEBSOCKETS_NETWORK_TYPE == NETWORK_WIFI_NINA) || (WEBSOCKETS_NETWORK_TYPE == NETWORK_SAMD_SEED) || (WEBSOCKETS_NETWORK_TYPE == NETWORK_UNOWIFIR4)
248248 // does not support delete (no destructor)
249249#else
250250 delete _client.ssl ;
@@ -261,7 +261,7 @@ void WebSocketsClient::loop(void) {
261261 _client.ssl ->setCACert (_CA_cert);
262262#elif defined(ESP8266) && defined(SSL_AXTLS)
263263 _client.ssl ->setCACert ((const uint8_t *)_CA_cert, strlen (_CA_cert) + 1 );
264- #elif (defined(ESP8266) || defined(ARDUINO_ARCH_RP2040)) && defined(SSL_BARESSL)
264+ #elif (defined(ESP8266) || defined(ARDUINO_ARCH_RP2040)) && defined(SSL_BARESSL)
265265 _client.ssl ->setTrustAnchors (_CA_cert);
266266#elif defined(WIO_TERMINAL) || defined(SEEED_XIAO_M0)
267267 _client.ssl ->setCACert (_CA_cert);
@@ -294,7 +294,7 @@ void WebSocketsClient::loop(void) {
294294 } else {
295295 DEBUG_WEBSOCKETS (" [WS-Client] connect ws...\n " );
296296 if (_client.tcp ) {
297- #if (WEBSOCKETS_NETWORK_TYPE == NETWORK_WIFI_NINA) || (WEBSOCKETS_NETWORK_TYPE == NETWORK_SAMD_SEED) || (WEBSOCKETS_NETWORK_TYPE == NETWORK_UNOWIFIR4)
297+ #if (WEBSOCKETS_NETWORK_TYPE == NETWORK_WIFI_NINA) || (WEBSOCKETS_NETWORK_TYPE == NETWORK_SAMD_SEED) || (WEBSOCKETS_NETWORK_TYPE == NETWORK_UNOWIFIR4)
298298 // does not support delete (no destructor)
299299#else
300300 delete _client.tcp ;
@@ -540,16 +540,16 @@ void WebSocketsClient::clientDisconnect(WSclient_t * client) {
540540
541541 if (client->tcp ) {
542542 if (client->tcp ->connected ()) {
543- #if (WEBSOCKETS_NETWORK_TYPE != NETWORK_ESP8266_ASYNC)
543+ #if (WEBSOCKETS_NETWORK_TYPE != NETWORK_ESP8266_ASYNC)
544544 client->tcp ->flush ();
545545#endif
546546 client->tcp ->stop ();
547547 }
548548 event = true ;
549- #if (WEBSOCKETS_NETWORK_TYPE == NETWORK_ESP8266_ASYNC)
549+ #if (WEBSOCKETS_NETWORK_TYPE == NETWORK_ESP8266_ASYNC)
550550 client->status = WSC_NOT_CONNECTED;
551551#else
552- #if (WEBSOCKETS_NETWORK_TYPE == NETWORK_WIFI_NINA) || (WEBSOCKETS_NETWORK_TYPE == NETWORK_SAMD_SEED) || (WEBSOCKETS_NETWORK_TYPE == NETWORK_UNOWIFIR4)
552+ #if (WEBSOCKETS_NETWORK_TYPE == NETWORK_WIFI_NINA) || (WEBSOCKETS_NETWORK_TYPE == NETWORK_SAMD_SEED) || (WEBSOCKETS_NETWORK_TYPE == NETWORK_UNOWIFIR4)
553553 // does not support delete (no destructor)
554554#else
555555 delete client->tcp ;
@@ -605,7 +605,7 @@ bool WebSocketsClient::clientIsConnected(WSclient_t * client) {
605605
606606 return false ;
607607}
608- #if (WEBSOCKETS_NETWORK_TYPE != NETWORK_ESP8266_ASYNC)
608+ #if (WEBSOCKETS_NETWORK_TYPE != NETWORK_ESP8266_ASYNC)
609609/* *
610610 * Handel incomming data from Client
611611 */
@@ -726,7 +726,7 @@ void WebSocketsClient::sendHeader(WSclient_t * client) {
726726 DEBUG_WEBSOCKETS (" [WS-Client][sendHeader] handshake %s" , (uint8_t *)handshake.c_str ());
727727 write (client, (uint8_t *)handshake.c_str (), handshake.length ());
728728
729- #if (WEBSOCKETS_NETWORK_TYPE == NETWORK_ESP8266_ASYNC)
729+ #if (WEBSOCKETS_NETWORK_TYPE == NETWORK_ESP8266_ASYNC)
730730 client->tcp ->readStringUntil (' \n ' , &(client->cHttpLine ), std::bind (&WebSocketsClient::handleHeader, this , client, &(client->cHttpLine )));
731731#endif
732732
@@ -801,7 +801,7 @@ void WebSocketsClient::handleHeader(WSclient_t * client, String * headerLine) {
801801 }
802802
803803 (*headerLine) = " " ;
804- #if (WEBSOCKETS_NETWORK_TYPE == NETWORK_ESP8266_ASYNC)
804+ #if (WEBSOCKETS_NETWORK_TYPE == NETWORK_ESP8266_ASYNC)
805805 client->tcp ->readStringUntil (' \n ' , &(client->cHttpLine ), std::bind (&WebSocketsClient::handleHeader, this , client, &(client->cHttpLine )));
806806#endif
807807 } else {
@@ -871,7 +871,7 @@ void WebSocketsClient::handleHeader(WSclient_t * client, String * headerLine) {
871871 headerDone (client);
872872
873873 runCbEvent (WStype_CONNECTED, (uint8_t *)client->cUrl .c_str (), client->cUrl .length ());
874- #if (WEBSOCKETS_NETWORK_TYPE != NETWORK_ESP8266_ASYNC)
874+ #if (WEBSOCKETS_NETWORK_TYPE != NETWORK_ESP8266_ASYNC)
875875 } else if (client->isSocketIO ) {
876876 if (client->cSessionId .length () > 0 ) {
877877 DEBUG_WEBSOCKETS (" [WS-Client][handleHeader] found cSessionId\n " );
@@ -899,7 +899,7 @@ void WebSocketsClient::handleHeader(WSclient_t * client, String * headerLine) {
899899void WebSocketsClient::connectedCb () {
900900 DEBUG_WEBSOCKETS (" [WS-Client] connected to %s:%u.\n " , _host.c_str (), _port);
901901
902- #if (WEBSOCKETS_NETWORK_TYPE == NETWORK_ESP8266_ASYNC)
902+ #if (WEBSOCKETS_NETWORK_TYPE == NETWORK_ESP8266_ASYNC)
903903 _client.tcp ->onDisconnect (std::bind ([](WebSocketsClient * c, AsyncTCPbuffer * obj, WSclient_t * client) -> bool {
904904 DEBUG_WEBSOCKETS (" [WS-Server][%d] Disconnect client\n " , client->num );
905905 client->status = WSC_NOT_CONNECTED;
@@ -915,12 +915,12 @@ void WebSocketsClient::connectedCb() {
915915
916916 _client.status = WSC_HEADER;
917917
918- #if (WEBSOCKETS_NETWORK_TYPE != NETWORK_ESP8266_ASYNC)
918+ #if (WEBSOCKETS_NETWORK_TYPE != NETWORK_ESP8266_ASYNC)
919919 // set Timeout for readBytesUntil and readStringUntil
920920 _client.tcp ->setTimeout (WEBSOCKETS_TCP_TIMEOUT);
921921#endif
922922
923- #if (WEBSOCKETS_NETWORK_TYPE == NETWORK_ESP8266) || (WEBSOCKETS_NETWORK_TYPE == NETWORK_ESP32) || (WEBSOCKETS_NETWORK_TYPE == NETWORK_RP2040)
923+ #if (WEBSOCKETS_NETWORK_TYPE == NETWORK_ESP8266) || (WEBSOCKETS_NETWORK_TYPE == NETWORK_ESP32) || (WEBSOCKETS_NETWORK_TYPE == NETWORK_RP2040)
924924 _client.tcp ->setNoDelay (true );
925925#endif
926926
@@ -950,7 +950,7 @@ void WebSocketsClient::connectFailedCb() {
950950 DEBUG_WEBSOCKETS (" [WS-Client] connection to %s:%u Failed\n " , _host.c_str (), _port);
951951}
952952
953- #if (WEBSOCKETS_NETWORK_TYPE == NETWORK_ESP8266_ASYNC)
953+ #if (WEBSOCKETS_NETWORK_TYPE == NETWORK_ESP8266_ASYNC)
954954
955955void WebSocketsClient::asyncConnect () {
956956 DEBUG_WEBSOCKETS (" [WS-Client] asyncConnect...\n " );
0 commit comments