mirror of
https://github.com/Links2004/arduinoWebSockets.git
synced 2025-07-15 16:30:31 +02:00
first steps to Client
This commit is contained in:
@ -38,6 +38,7 @@ extern "C" {
|
||||
* @param reasonLen
|
||||
*/
|
||||
void WebSockets::clientDisconnect(WSclient_t * client, uint16_t code, char * reason, size_t reasonLen) {
|
||||
DEBUG_WEBSOCKETS("[WS-Server][%d][handleWebsocket] clientDisconnect code: %u\n", client->num, code);
|
||||
if(client->status == WSC_CONNECTED && code) {
|
||||
if(reason) {
|
||||
sendFrame(client, WSop_close, (uint8_t *) reason, reasonLen);
|
||||
@ -60,6 +61,10 @@ void WebSockets::clientDisconnect(WSclient_t * client, uint16_t code, char * rea
|
||||
*/
|
||||
void WebSockets::sendFrame(WSclient_t * client, WSopcode_t opcode, uint8_t * payload, size_t length) {
|
||||
|
||||
if(!client->tcp.connected()) {
|
||||
return;
|
||||
}
|
||||
|
||||
uint8_t buffer[16] = { 0 };
|
||||
uint8_t i = 0;
|
||||
|
||||
|
Reference in New Issue
Block a user