MCPcopy Create free account
hub / github.com/JoaoLopesF/RemoteDebug / clientIsConnected

Method clientIsConnected

src/utility/WebSocketsClient.cpp:403–428  ·  view source on GitHub ↗

* get client state * @param client WSclient_t * ptr to the client struct * @return true = conneted */

Source from the content-addressed store, hash-verified

401 * @return true = conneted
402 */
403bool 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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected