Add upgrade handler to fix WebSocketBehavior template deduction on old examples (#1131)
This commit is contained in:
@@ -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");
|
||||
|
||||
@@ -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 */
|
||||
},
|
||||
|
||||
@@ -22,6 +22,7 @@ int main() {
|
||||
.idleTimeout = 10,
|
||||
.maxBackpressure = 1 * 1024 * 1024,
|
||||
/* Handlers */
|
||||
.upgrade = nullptr,
|
||||
.open = [](auto *ws) {
|
||||
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user