4 ms·
How does this fare compared to uWebSockets? https://github.com/uNetworking/uWebSockets https://github.com/uNetworking/uWebSockets
by porsager 5y ago
How does this fare compared to uWebSockets? https://github.com/uNetworking/uWebSockets https://github.com/uNetworking/uWebSockets
- kreetx 5y agouWebSockets appears to be significantly faster, but this one is second: https://github.com/uNetworking/uWebSockets/blob/master/misc/websocket_lineup.png https://github.com/uNetworking/uWebSockets/blob/master/misc/... (linked from uWebSockets main github)
- johnnyApplePRNG 5y agouWebSockets does not have a websocket client interface.
- zarzavat 5y agoIf the maintainer is sane, then that would be one advantage over uwebsockets.
- gemakelijk 5y agoLike most websocket library, uWebSockets works by calling some sort of send/write function. You give the data you want to send, which is a sequence (a string or a vector). The underlying library will take care of buffering that, and the size of that buffer is unbounded. In most of them there is no way to know how much is buffered. But with libwebsocket, it will call a callback written by you, it will call it every time it is ready to send. And then you have to call a write function that does not guarantee you it will write the whole buffer you give it. This can be useful for web based games, you keep the last version of the position of each object, and send them one by one when the client is ready to receive. The memory usage will then be bounded to: size of message * number of objects + number of players (each player can have a message that is currently kept in memory until it is entirely sent, since multiple calls to the callback may be required to send a whole message. The libwebsocket site claims that it is the receiving side that decides when it is ready to send. I don't know exactly how it is determined but I think the sender uses TCP ACKs, the window size...