Don't pass req in open handler
This commit is contained in:
@@ -16,7 +16,7 @@ int main() {
|
||||
.idleTimeout = 10,
|
||||
.maxBackpressure = 1 * 1024 * 1204,
|
||||
/* Handlers */
|
||||
.open = [](auto *ws, auto *req) {
|
||||
.open = [](auto *ws) {
|
||||
/* Let's make every connection subscribe to the "broadcast" topic */
|
||||
ws->subscribe("broadcast");
|
||||
},
|
||||
|
||||
@@ -84,7 +84,7 @@ int main() {
|
||||
|
||||
|
||||
},
|
||||
.open = [](auto *ws, auto *req) {
|
||||
.open = [](auto *ws) {
|
||||
/* Open event here, you may access ws->getUserData() which points to a PerSocketData struct */
|
||||
std::cout << "Something is: " << static_cast<PerSocketData *>(ws->getUserData())->something << std::endl;
|
||||
},
|
||||
|
||||
@@ -22,7 +22,7 @@ int main() {
|
||||
.idleTimeout = 10,
|
||||
.maxBackpressure = 1 * 1024 * 1204,
|
||||
/* Handlers */
|
||||
.open = [](auto *ws, auto *req) {
|
||||
.open = [](auto *ws) {
|
||||
|
||||
},
|
||||
.message = [](auto *ws, std::string_view message, uWS::OpCode opCode) {
|
||||
|
||||
Reference in New Issue
Block a user