Skip to content

Commit 8967356

Browse files
committed
improve ram usage on one char send
1 parent d2043bf commit 8967356

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/SocketIOclient.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ void SocketIOclient::runCbEvent(WStype_t type, uint8_t * payload, size_t length)
4242
case WStype_CONNECTED: {
4343
DEBUG_WEBSOCKETS("[wsIOc] Connected to url: %s\n", payload);
4444
// send message to server when Connected
45-
// socket.io upgrade confirmation message (required)
45+
// Engine.io upgrade confirmation message (required)
4646
sendTXT(eIOtype_UPGRADE);
4747
}
4848
break;

src/WebSocketsClient.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,9 @@ bool WebSocketsClient::sendTXT(String & payload) {
216216
}
217217

218218
bool WebSocketsClient::sendTXT(char payload) {
219-
return sendTXT((uint8_t *) &payload, 1);
219+
uint8_t buf[WEBSOCKETS_MAX_HEADER_SIZE + 2] = {0x00};
220+
buf[WEBSOCKETS_MAX_HEADER_SIZE] = payload;
221+
return sendTXT(buf, 1, true);
220222
}
221223

222224
/**

0 commit comments

Comments
 (0)