Add upgrade handler to fix WebSocketBehavior template deduction on old examples (#1131)

This commit is contained in:
Andy
2020-11-23 03:14:41 -08:00
committed by GitHub
parent 72e99519a9
commit 2530872a1b
3 changed files with 3 additions and 0 deletions
+1
View File
@@ -16,6 +16,7 @@ int main() {
.idleTimeout = 10,
.maxBackpressure = 1 * 1024 * 1024,
/* Handlers */
.upgrade = nullptr,
.open = [](auto *ws) {
/* Let's make every connection subscribe to the "broadcast" topic */
ws->subscribe("broadcast");
+1
View File
@@ -24,6 +24,7 @@ int main() {
.idleTimeout = 10,
.maxBackpressure = 1 * 1024 * 1024,
/* Handlers */
.upgrade = nullptr,
.open = [](auto *ws) {
/* Open event here, you may access ws->getUserData() which points to a PerSocketData struct */
},
+1
View File
@@ -22,6 +22,7 @@ int main() {
.idleTimeout = 10,
.maxBackpressure = 1 * 1024 * 1024,
/* Handlers */
.upgrade = nullptr,
.open = [](auto *ws) {
},