You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I'm testing juce_mongoose, which is a direct port of mongoose-cpp (I checked that the code is the same for this issue).
When testing the websocket example - I modified it a bit to send 10 messages in a row instead of just one -, the websocketReady function gets called at every new message, but the websocketdata gets called randomly (2 times out of 100).
I tried to trace back a bit and it seems that the function "event_handler" (Server.cpp line 39) gets called at every message, and then the "websocketReady" gets called immediately. This then goes into Websockets::add and it replaces the previous connection all the time.
I'm not sure what should be done, but I would expect that webSocketready gets only called once, and then websocketdata gets called for all the incoming data, right ?
On the browser side, the Websocket is behaving "normally", meaning that it detects a connection at first, sends the message, receive some.
Though it receives a disconnection in the end even though I didn't close the websocket on the cpp side...
Also, in websocketReady , the getId() return -1.
Thanks !
The text was updated successfully, but these errors were encountered:
benkuper
changed the title
websocketReady called on every message received instead of webSocketData
Error 1006, JS gets disconnected when CPP sends data
Jun 17, 2020
Hello, I'm testing juce_mongoose, which is a direct port of mongoose-cpp (I checked that the code is the same for this issue).
When testing the websocket example - I modified it a bit to send 10 messages in a row instead of just one -, the websocketReady function gets called at every new message, but the websocketdata gets called randomly (2 times out of 100).
I tried to trace back a bit and it seems that the function "event_handler" (Server.cpp line 39) gets called at every message, and then the "websocketReady" gets called immediately. This then goes into Websockets::add and it replaces the previous connection all the time.
I'm not sure what should be done, but I would expect that webSocketready gets only called once, and then websocketdata gets called for all the incoming data, right ?
On the browser side, the Websocket is behaving "normally", meaning that it detects a connection at first, sends the message, receive some.
Though it receives a disconnection in the end even though I didn't close the websocket on the cpp side...
Also, in websocketReady , the getId() return -1.
Thanks !
The text was updated successfully, but these errors were encountered: