Skip to content

Commit 2531811

Browse files
committed
add namespace join to socket.io examples
1 parent 08caf3b commit 2531811

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

examples/esp8266/WebSocketClientSocketIO/WebSocketClientSocketIO.ino

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ void socketIOEvent(socketIOmessageType_t type, uint8_t * payload, size_t length)
2929
break;
3030
case sIOtype_CONNECT:
3131
USE_SERIAL.printf("[IOc] Connected to url: %s\n", payload);
32+
33+
// join default namespace (no auto join in Socket.IO V3)
34+
socketIO.send(sIOtype_CONNECT, "/");
3235
break;
3336
case sIOtype_EVENT:
3437
USE_SERIAL.printf("[IOc] get event: %s\n", payload);

examples/esp8266/WebSocketClientSocketIOack/WebSocketClientSocketIOack.ino

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ void socketIOEvent(socketIOmessageType_t type, uint8_t * payload, size_t length)
3030
break;
3131
case sIOtype_CONNECT:
3232
USE_SERIAL.printf("[IOc] Connected to url: %s\n", payload);
33+
34+
// join default namespace (no auto join in Socket.IO V3)
35+
socketIO.send(sIOtype_CONNECT, "/");
3336
break;
3437
case sIOtype_EVENT:
3538
{

0 commit comments

Comments
 (0)