* get client state * @param client WSclient_t * ptr to the client struct * @return true = conneted */
| 401 | * @return true = conneted |
| 402 | */ |
| 403 | bool WebSocketsClient::clientIsConnected(WSclient_t * client) { |
| 404 | |
| 405 | if(!client->tcp) { |
| 406 | return false; |
| 407 | } |
| 408 | |
| 409 | if(client->tcp->connected()) { |
| 410 | if(client->status != WSC_NOT_CONNECTED) { |
| 411 | return true; |
| 412 | } |
| 413 | } else { |
| 414 | // client lost |
| 415 | if(client->status != WSC_NOT_CONNECTED) { |
| 416 | DEBUG_WEBSOCKETS("[WS-Client] connection lost.\n"); |
| 417 | // do cleanup |
| 418 | clientDisconnect(client); |
| 419 | } |
| 420 | } |
| 421 | |
| 422 | if(client->tcp) { |
| 423 | // do cleanup |
| 424 | clientDisconnect(client); |
| 425 | } |
| 426 | |
| 427 | return false; |
| 428 | } |
| 429 | #if (WEBSOCKETS_NETWORK_TYPE != NETWORK_ESP8266_ASYNC) |
| 430 | /** |
| 431 | * Handel incomming data from Client |
nothing calls this directly
no outgoing calls
no test coverage detected