Open
Description
I have a socket server, where I print the message that I receive
When using this code, it works and the server prints 'test';
int main() {
sio::client h;
h.connect("http://localhost:8000/device");
h.set_socket_open_listener(std::bind([&]() {
h.socket("device")->emit("init", {"test"});
})
}
But when I us this code, I get empty message;
int main() {
sio::client h;
string msg = "test";
h.connect("http://localhost:8000/device");
h.set_socket_open_listener(std::bind([&]() {
h.socket("device")->emit("init", {msg});
})
}