Wireshark flooded with [PSH, ACK] packets when using websockets
This line in Server::poll()
mg_iterate_over_connections(server, iterate_callback, ¤t_timer);
is sending packet to all websockets connection in a loop, which doesn't seem right. I tested other websocket libraries and this behavior is not there. It may be related to the other issue I posted. Generally, either I have no clue on how to use websockets in mongoose or there is something very wrong on how it's implemented :
- data is sent out constantly at a very fast rate, even when no connection is active
- websocketReady is called every time a packet is sent from an already connected socket
- websocketData is not receiving everything, but receives ad vitam eternam the latest data sent
- sending anything to a connected socket closes the connection with a 1006 status.
Am I missing something here ?? I'm not doing anything fancy, just trying out the library because it's one of the only ones to support both http request AND websocket, WITHOUT relying on Asio, but the websocket part is seems so broken...
Thank you in advance
Hello, I am sorry but it is unlikely I can investigate this
However, note that this repo is only a binding over https://github.com/cesanta/mongoose/ which is a C web server, and it's been a while it was not updated.
You should consider:
- Trying if your issue also exists in the C version
- If it does, report it over there opening an issue
- If it doesn't, consider either switching to C or updating those bindings to match upstream mongoose
(And I would not be surprised if the WebSockets part is broken, however I am sorry that you will have to investigare further yourself if you want to get at the bottom of this :sweat_smile:)
No worries, thank you for answering already, this is the bigger part of knowing how to handle the situation :) I'm in a similar position myself with little time to dedicate on other people's problems. FYI, my end goal is to integrate it in my software : http://benjamin.kuperberg.fr/chataigne to be able to expose the user-customizable dashboard to a webpage with live control.
Thank you for the info, if I find something I'll post it here (but it's likely that I'm switching over websocketpp ;)
This project looks good! But indeed you should consider switching to a maintained project for websockets
There is also Qt itself providing an implementation, this is a way much more serious lead https://doc.qt.io/qt-5/qtwebsockets-index.html
Thank you :) Chataigne is based on JUCE, not Qt so I can't use it :)
And what is your problem with boost ?
I managed to not have it as a dependency for the whole project, and I really want to try without, because it will just make it much more heavy and painful to maintain / collaborate.
Right now, everything is pretty much working on its own (with the JUCE dependency), so when you want to get on it, even though it's a pretty big piece of code, it's quite easy to get started and work. I'm afraid that including boost would just make a lot of things more complicated.