mirror of
https://github.com/Links2004/arduinoWebSockets.git
synced 2025-07-14 15:56:30 +02:00
add deprecated warning for loop in async mode
fix sync mode
This commit is contained in:
@ -340,7 +340,7 @@ void WebSocketsClient::handleClientData(void) {
|
|||||||
switch(_client.status) {
|
switch(_client.status) {
|
||||||
case WSC_HEADER:
|
case WSC_HEADER:
|
||||||
{
|
{
|
||||||
String headerLine = _client->tcp->readStringUntil('\n');
|
String headerLine = _client.tcp->readStringUntil('\n');
|
||||||
handleHeader(&_client, &headerLine);
|
handleHeader(&_client, &headerLine);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -98,15 +98,15 @@ void WebSocketsServer::begin(void) {
|
|||||||
DEBUG_WEBSOCKETS("[WS-Server] Server Started.\n");
|
DEBUG_WEBSOCKETS("[WS-Server] Server Started.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if (WEBSOCKETS_NETWORK_TYPE != NETWORK_ESP8266_ASYNC)
|
||||||
/**
|
/**
|
||||||
* called in arduino loop
|
* called in arduino loop
|
||||||
*/
|
*/
|
||||||
void WebSocketsServer::loop(void) {
|
void WebSocketsServer::loop(void) {
|
||||||
#if (WEBSOCKETS_NETWORK_TYPE != NETWORK_ESP8266_ASYNC)
|
|
||||||
handleNewClients();
|
handleNewClients();
|
||||||
handleClientData();
|
handleClientData();
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* set callback function
|
* set callback function
|
||||||
|
@ -42,7 +42,14 @@ public:
|
|||||||
~WebSocketsServer(void);
|
~WebSocketsServer(void);
|
||||||
|
|
||||||
void begin(void);
|
void begin(void);
|
||||||
|
#if (WEBSOCKETS_NETWORK_TYPE != NETWORK_ESP8266_ASYNC)
|
||||||
void loop(void);
|
void loop(void);
|
||||||
|
#else
|
||||||
|
// Async interface not need a loop call
|
||||||
|
void loop(void) __attribute__ ((deprecated)) {
|
||||||
|
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void onEvent(WebSocketServerEvent cbEvent);
|
void onEvent(WebSocketServerEvent cbEvent);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user