LoverNet
LoverNet copied to clipboard
Wiki example crashes with multiple clients
This example https://github.com/josefnpat/LoverNet/wiki/Example%3A-Sending-Latest-Data-To-Client crashes with Love 11 when I launch multiple clients:
Error: .\lovernet.lua:240: Error during service
stack traceback:
[string "boot.lua"]:637: in function <[string "boot.lua"]:633>
[C]: in function 'service'
.\lovernet.lua:240: in function 'update'
main.lua:13: in function 'update'
[string "boot.lua"]:509: in function <[string "boot.lua"]:493>
[C]: in function 'xpcall'
In my case, it crashes with 7 clients. If I duplicate the lovernet:update(dt)
line in the server, it works "better". As in, it works with 7 clients. But if I add more (to the total of 12), it still crashes. Works ok with Love 0.10, even though it's visibly slow with this number of clients.
Last commit was 2 years ago, and there hasn't been many updates since 2016, specially to docs. Also to note is that LÖVE 11.x was released on 2018 which is AFTER 2016, where the library was still being actively maintained. LÖVE 11.x updated the luasocket library to a newer version which can result in compatibility issues in it's API or overall functionality.
I don't think you should be calling lovernet:update(dt)
repeatedly like that since you are confusing the internal timers by the way.
I would recommend you either look into other networking libraries, dive into the source and fix this library (you can then submit PRs to both the source code and the docs) or you can write your own networking code with luasocket and/or lue-enet (both built into LÖVE)
To be perfectly honest, I created this issue mainly as a flag for those coming from awesome-love2d, so that they have an easier time seeing that no, this library doesn't work. Thanks for confirming it, by the way.
Will ask Seppi and posibly request for it to be removed from awesome-love2d if not further support can be expected.
Thank you!