Hi,
Fisrt of all,My english is very poor,I sincerely hope you can understand what i wrote and give me some precious advice.
I wanna send some consecutive message(like video/audio data).
pseudocode is as follows:
.message = [](auto*ws, std::string_view message, uWS::OpCode opCode) {
while(flag) {
ws->send(std::string_view(videoData(), dataSize()), OpCode::BINARY);
}
},
.close = [](auto *ws/*ws*/, int /*code*/, std::string_view /*message*/) {
flag = false;
}
I know the library is single threaded, so when i send consecutive data to client in a while loop, I don't know when the client close,and 'flag = false' is unreachable.
Hi,
Fisrt of all,My english is very poor,I sincerely hope you can understand what i wrote and give me some precious advice.
I wanna send some consecutive message(like video/audio data).
pseudocode is as follows:
I know the library is single threaded, so when i send consecutive data to client in a while loop, I don't know when the client close,and 'flag = false' is unreachable.