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

Method disconnect

src/RemoteDebug.cpp:642–667  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

640// Disconnect client
641
642void RemoteDebug::disconnect(boolean onlyTelnetClient) {
643
644 // Disconnect
645
646 if (onlyTelnetClient) {
647 if (_connected) {
648 TelnetClient.println("* Closing client connection ..."); // this is to web app new conn not receive it
649 }
650 } else {
651 debugPrintln("* Closing client connection ...");
652 }
653
654 _silence = false;
655 _silenceTimeout = 0;
656
657 if (_connected) { // By telnet
658 TelnetClient.stop();
659 _connected = false;
660 }
661#ifndef WEBSOCKET_DISABLED // For web socket server (app)
662 if (_connectedWS && !onlyTelnetClient) {
663 DebugWS.disconnect(); // Disconnect client
664 _connectedWS = false;
665 }
666#endif
667}
668
669// Connection/disconnection event
670

Callers 1

onConnectMethod · 0.45

Calls 1

stopMethod · 0.45

Tested by

no test coverage detected